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