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,
|
2016-02-24 21:01:27 +00:00
|
|
|
'autorollback': True,
|
2014-11-13 17:51:37 +00:00
|
|
|
}
|
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
|
2016-05-13 22:29:57 +00:00
|
|
|
FEATURE_ACI_CONVERSION = True
|
2015-08-17 20:26:20 +00:00
|
|
|
|
|
|
|
CLOUDWATCH_NAMESPACE = None
|
2015-10-23 19:20:28 +00:00
|
|
|
|
|
|
|
FEATURE_SECURITY_SCANNER = True
|
2016-03-01 21:14:56 +00:00
|
|
|
FEATURE_SECURITY_NOTIFICATIONS = True
|
2016-05-02 19:29:31 +00: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 22:29:57 +00:00
|
|
|
|
|
|
|
SIGNING_ENGINE = 'gpg2'
|
|
|
|
|
|
|
|
GPG2_PRIVATE_KEY_NAME = 'EEB32221'
|
2016-05-23 21:10:03 +00:00
|
|
|
GPG2_PRIVATE_KEY_FILENAME = 'test/data/signing-private.gpg'
|
|
|
|
GPG2_PUBLIC_KEY_FILENAME = 'test/data/signing-public.gpg'
|
2016-05-13 22:29:57 +00:00
|
|
|
|
2016-05-31 20:48:19 +00:00
|
|
|
INSTANCE_SERVICE_KEY_KID_LOCATION = 'test/data/test.kid'
|
|
|
|
INSTANCE_SERVICE_KEY_LOCATION = 'test/data/test.pem'
|
2016-07-14 19:48:21 +00:00
|
|
|
|
|
|
|
PROMETHEUS_AGGREGATOR_URL = None
|
2016-12-08 23:35:42 +00:00
|
|
|
|
|
|
|
FEATURE_GITHUB_LOGIN = True
|
|
|
|
FEATURE_GOOGLE_LOGIN = True
|
|
|
|
FEATURE_DEX_LOGIN = True
|
|
|
|
|
|
|
|
DEX_LOGIN_CONFIG = {
|
|
|
|
'CLIENT_ID': 'someclientid',
|
|
|
|
'OIDC_SERVER': 'https://oidcserver/',
|
|
|
|
}
|