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=''), }
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) }
class Player(typesystem.Object): properties = { 'name': typesystem.string(max_length=100), 'rating': Rating, 'sports': Sports, 'retired': typesystem.boolean() }
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 }
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') }
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']
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) }
class Env(environment.Environment): properties = { 'DEBUG': typesystem.boolean(default=False), 'DATABASE_URL': typesystem.string() }
class Env(environment.Environment): properties = { 'POKEME_DEBUG': typesystem.boolean(default=False), 'POKEME_DATABASE_URL': typesystem.string(), } required = ['POKEME_DEBUG', 'POKEME_DATABASE_URL']
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.'
class Env(environment.Environment): properties = { 'DEBUG': typesystem.boolean(default=True), 'DATABASE_URL': typesystem.string(default='sqlite:///db.sqlite3'), }