示例#1
0
class Env(environment.Environment):
    """
    Simple mapping from environment settings.
    """
    properties = {
        'PYTHON_DEBUG':
        typesystem.boolean(default=False),
        'DEBUG':
        typesystem.boolean(default=False),
        'CLIENT_ID':
        typesystem.string(default='3430dd2a3e46404eb07c480759af0320'),
        'CLIENT_SECRET':
        typesystem.string(default='283832c3133849b19ae90b6b596ef933'),
        'REDIS_URL':
        typesystem.string(default='redis://127.0.0.1:6379/0'),
        'DATABASE_URL':
        typesystem.string(default=''),
        'VERIFICATION_TOKEN':
        typesystem.string(default='2514b2465e7448ecbdc55cff56b426b9'),
        'SLACK_BOT_TOKEN':
        typesystem.string(default='e544eb2e1cfb4abda385fb6e9b1e950e'),
        'SLACK_API_SCOPE':
        typesystem.string(default=''),
        'SLACK_BOT_NAME':
        typesystem.string(default=''),
        'SLACK_BOT_OAUTH_REDIR':
        typesystem.string(default=''),
    }
示例#2
0
class Env(environment.Environment):
    properties = {
        'DB_ENGINE': typesystem.string(default='django.db.backends.sqlite3'),
        'DB_PORT': typesystem.string(default=''),
        'DB_NAME': typesystem.string(default='db.local'),
        'DB_HOST': typesystem.string(default=''),
        'DB_USER': typesystem.string(default=''),
        'DB_PASSWORD': typesystem.string(default=''),
        'SECRET_KEY': typesystem.string(default='please_change_it'),
        'JWT_SECRET': typesystem.string(default='please_change_it'),
        'DEBUG': typesystem.boolean(default=True),
        'TEST_RUNNING': typesystem.boolean(default=False)
    }
示例#3
0
文件: app.py 项目: karingula/star
class Player(typesystem.Object):
    properties = {
        'name': typesystem.string(max_length=100),
        'rating': Rating,
        'sports': Sports,
        'retired': typesystem.boolean()
    }
示例#4
0
class ToDoNote(typesystem.Object):
    properties = {
        'id': typesystem.integer(minimum=0),
        'text': typesystem.string(max_length=100),
        'complete': typesystem.boolean(),
        'percent_complete': typesystem.number(),
        'category': Category
    }
示例#5
0
文件: app.py 项目: wifimedia/rd
class Env(environment.Environment):
    properties = {
        'DEBUG': typesystem.boolean(default=True),
        'DB_NAME': typesystem.string(default='rd'),
        'DB_HOST': typesystem.string(default='db'),
        'DB_PASSWORD': typesystem.string(default='fredFlint'),
        'DB_LOGIN': typesystem.string(default='rd')
    }
示例#6
0
class HighScore(typesystem.Object):
    properties = {
        'name': typesystem.string(max_length=100),
        'score': typesystem.integer(minimum=0, maximum=100),
        'completed': typesystem.boolean(default=False),
        'difficulty': typesystem.enum(enum=['easy', 'medium', 'hard']),
        'location': typesystem.newtype(Location, default={'latitude': 0.0, 'longitude': 0.0})
    }
    required = ['name']
示例#7
0
class Book(typesystem.Object):
    properties = {
        'id': typesystem.Integer,
        'title': typesystem.string(max_length=256),
        'author': typesystem.string(max_length=256),
        'publisher': typesystem.string(max_length=256),
        'publish_date': typesystem.string(max_length=10),
        'rating': BookRating,
        'checked_out': typesystem.boolean(default=False)
    }
示例#8
0
class Env(environment.Environment):
    properties = {
        'DEBUG': typesystem.boolean(default=False),
        'DATABASE_URL': typesystem.string()
    }
示例#9
0
class Env(environment.Environment):
    properties = {
        'POKEME_DEBUG': typesystem.boolean(default=False),
        'POKEME_DATABASE_URL': typesystem.string(),
    }
    required = ['POKEME_DEBUG', 'POKEME_DATABASE_URL']
示例#10
0
def test_boolean_kwargs():
    CustomBool = typesystem.boolean(errors={'type': 'Must be true or false.'})
    with pytest.raises(exceptions.TypeSystemError) as exc:
        CustomBool('invalid')
    assert str(exc.value) == 'Must be true or false.'
示例#11
0
class Env(environment.Environment):
    properties = {
        'DEBUG': typesystem.boolean(default=True),
        'DATABASE_URL': typesystem.string(default='sqlite:///db.sqlite3'),
    }