~elopio/ubuntuone-testing/fix-1046476

« back to all changes in this revision

Viewing changes to ubuntuone/web/tests/sst/shared/config/schema.py

  • Committer: Tarmac
  • Author(s): leo.arias at canonical
  • Date: 2012-08-28 04:11:21 UTC
  • mfrom: (114.2.13 configglue)
  • Revision ID: tarmac-20120828041121-5u9k8u456b8ey1e0
Added configglue configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
# Copyright 2012 Canonical Ltd.
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify it
 
6
# under the terms of the GNU General Public License version 3, as published
 
7
# by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
12
# PURPOSE.  See the GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License along
 
15
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
from configglue import schema
 
18
from configglue.glue import configglue
 
19
import sys
 
20
import os.path
 
21
 
 
22
class SstSchema(schema.Schema):
 
23
 
 
24
    default_timeout = schema.IntOption(default=40)
 
25
 
 
26
    class Server(schema.Section):
 
27
        environment = schema.StringOption(default='staging')
 
28
        url = schema.StringOption(default=None)
 
29
        sso_url = schema.StringOption(default=None)
 
30
        files_url = schema.StringOption(default=None)
 
31
 
 
32
 
 
33
    class DefaultUser(schema.Section):
 
34
        full_name = schema.StringOption()
 
35
        email_address = schema.StringOption()
 
36
        password = schema.StringOption()
 
37
 
 
38
 
 
39
    class NewUser(schema.Section):
 
40
        full_name_pattern = schema.StringOption(default='Test user %s',
 
41
            raw=True)
 
42
        email_address_pattern = schema.StringOption(raw=True)
 
43
        password = schema.StringOption(default='Hola123*')
 
44
        imap_server = schema.StringOption()
 
45
        imap_port = schema.IntOption(default=993)
 
46
        imap_use_ssl = schema.BoolOption(default=True)
 
47
        imap_username = schema.StringOption()
 
48
        imap_password = schema.StringOption()
 
49
 
 
50
 
 
51
    class MusicUser(schema.Section):
 
52
        full_name = schema.StringOption()
 
53
        email_address = schema.StringOption()
 
54
        password = schema.StringOption()
 
55
 
 
56
# XXX The command line arguments are for SST, not for u1 tests.
 
57
# We will do something to SST on the future so it uses configglue, 
 
58
# or makes available all the additional arguments.
 
59
sys.argv = []
 
60
current_dir = os.path.dirname(os.path.abspath(__file__))
 
61
glue = configglue(SstSchema, os.path.join(current_dir, 'local.cfg'))