2014-11-13 17:51:37 +00:00
|
|
|
import os
|
|
|
|
|
2014-05-29 17:57:57 +00:00
|
|
|
from datetime import datetime, timedelta
|
2015-01-30 21:32:37 +00:00
|
|
|
from tempfile import NamedTemporaryFile
|
2014-05-29 17:57:57 +00:00
|
|
|
|
2014-04-07 20:59:22 +00:00
|
|
|
from config import DefaultConfig
|
|
|
|
|
|
|
|
|
|
|
|
class FakeTransaction(object):
|
|
|
|
def __enter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __exit__(self, exc_type, value, traceback):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2015-01-30 21:32:37 +00:00
|
|
|
TEST_DB_FILE = NamedTemporaryFile(delete=True)
|
|
|
|
|
|
|
|
|
2014-04-07 20:59:22 +00:00
|
|
|
class TestConfig(DefaultConfig):
|
|
|
|
TESTING = True
|
2015-01-05 17:31:02 +00:00
|
|
|
SECRET_KEY = 'a36c9d7d-25a9-4d3f-a586-3d2f8dc40a83'
|
2015-09-15 18:33:35 +00:00
|
|
|
BILLING_TYPE = 'FakeStripe'
|
2014-04-07 20:59:22 +00:00
|
|
|
|
2015-09-08 16:35:03 +00:00
|
|
|
TEST_DB_FILE = TEST_DB_FILE
|
2015-01-30 21:32:37 +00:00
|
|
|
DB_URI = os.environ.get('TEST_DATABASE_URI', 'sqlite:///{0}'.format(TEST_DB_FILE.name))
|
2014-11-13 17:51:37 +00:00
|
|
|
DB_CONNECTION_ARGS = {
|
|
|
|
'threadlocals': True,
|
|
|
|
'autorollback': True
|
|
|
|
}
|
2014-04-07 20:59:22 +00:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def create_transaction(db):
|
|
|
|
return FakeTransaction()
|
|
|
|
|
|
|
|
DB_TRANSACTION_FACTORY = create_transaction
|
|
|
|
|
2014-11-13 18:20:21 +00:00
|
|
|
DISTRIBUTED_STORAGE_CONFIG = {'local_us': ['FakeStorage', {}], 'local_eu': ['FakeStorage', {}]}
|
2014-06-17 20:03:43 +00:00
|
|
|
DISTRIBUTED_STORAGE_PREFERENCE = ['local_us']
|
2014-04-07 20:59:22 +00:00
|
|
|
|
2014-05-09 22:45:11 +00:00
|
|
|
BUILDLOGS_MODULE_AND_CLASS = ('test.testlogs', 'testlogs.TestBuildLogs')
|
2014-07-08 22:19:13 +00:00
|
|
|
BUILDLOGS_OPTIONS = ['devtable', 'building', 'deadbeef-dead-beef-dead-beefdeadbeef', False]
|
2014-04-07 20:59:22 +00:00
|
|
|
|
2014-09-09 19:54:03 +00:00
|
|
|
USERFILES_LOCATION = 'local_us'
|
2014-05-12 18:45:19 +00:00
|
|
|
|
|
|
|
FEATURE_SUPER_USERS = True
|
2014-05-30 19:48:20 +00:00
|
|
|
FEATURE_BILLING = True
|
2014-09-22 23:11:48 +00:00
|
|
|
FEATURE_MAILING = True
|
2014-05-12 18:45:19 +00:00
|
|
|
SUPER_USERS = ['devtable']
|
2014-05-28 18:06:21 +00:00
|
|
|
|
|
|
|
LICENSE_USER_LIMIT = 500
|
2014-05-29 17:57:57 +00:00
|
|
|
LICENSE_EXPIRATION = datetime.now() + timedelta(weeks=520)
|
|
|
|
LICENSE_EXPIRATION_WARNING = datetime.now() + timedelta(weeks=520)
|
2014-11-24 21:07:38 +00:00
|
|
|
|
2014-05-30 22:28:18 +00:00
|
|
|
FEATURE_GITHUB_BUILD = True
|
2016-01-20 21:33:10 +00:00
|
|
|
FEATURE_BITTORRENT = True
|
2015-08-17 20:26:20 +00:00
|
|
|
|
|
|
|
CLOUDWATCH_NAMESPACE = None
|
2015-10-23 19:20:28 +00:00
|
|
|
|
|
|
|
FEATURE_SECURITY_SCANNER = True
|
|
|
|
SECURITY_SCANNER = {
|
|
|
|
'ENDPOINT': 'http://localhost/some/invalid/path',
|
|
|
|
'ENGINE_VERSION_TARGET': 1,
|
|
|
|
'API_CALL_TIMEOUT': 1
|
|
|
|
}
|