import os
import sys
+import platform
import redisco
'django.contrib.staticfiles',
'rest_framework',
'lcm.pub.database',
+ 'lcm.swagger',
'drf_yasg'
]
},
}
+# DATABASES = {}
+# DATABASES['default'] = {
+# 'ENGINE': 'django.db.backends.sqlite3',
+# 'NAME': 'D:/etsi-plug-test/db/nfvo',
+# }
+
redisco.connection_setup(host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWD, db=0)
# CACHE_BACKEND = 'redis_cache.cache://%s@%s:%s' % (REDIS_PASSWD, REDIS_HOST, REDIS_PORT)
STATIC_URL = '/static/'
-STATICFILES_DIRS = [
- os.path.join(BASE_DIR, "static")
-]
-
-pub_config.CATALOG_ROOT_PATH = os.path.join(STATICFILES_DIRS[0], "catalog")
-pub_config.CATALOG_URL_PATH = "static/catalog"
pub_config.AAI_BASE_URL = "http://%s:%s/aai/v11" % (pub_config.MSB_SERVICE_IP, pub_config.MSB_SERVICE_PORT)
pub_config.SDC_BASE_URL = "http://%s:%s/api" % (pub_config.MSB_SERVICE_IP, pub_config.MSB_SERVICE_PORT)
-#
-# LOGGING = {
-# 'version': 1,
-# 'disable_existing_loggers': True,
-# 'formatters': {
-# 'standard': {
-# 'format': '%(asctime)s:[%(name)s]:[%(filename)s]-[%(lineno)d] [%(levelname)s]:%(message)s',
-# },
-# },
-# 'filters': {
-# },
-# 'handlers': {
-# 'lcm_handler': {
-# 'level': 'DEBUG',
-# 'class': 'logging.handlers.RotatingFileHandler',
-# 'filename': os.path.join(BASE_DIR, 'logs/runtime_lcm.log'),
-# 'formatter': 'standard',
-# 'maxBytes': 1024 * 1024 * 50,
-# 'backupCount': 5,
-# },
-# },
-#
-# 'loggers': {
-# 'lcm': {
-# 'handlers': ['lcm_handler'],
-# 'level': 'DEBUG',
-# 'propagate': False
-# },
-# }
-# }
-LOGGING_CONFIG = None
-# yaml configuration of logging
-LOGGING_FILE = os.path.join(BASE_DIR, 'lcm/log.yml')
-log_config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
+
+if platform.system() == 'Windows' or 'test' in sys.argv:
+ LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': True,
+ 'formatters': {
+ 'standard': {
+ 'format': '%(asctime)s:[%(name)s]:[%(filename)s]-[%(lineno)d] [%(levelname)s]:%(message)s',
+ },
+ },
+ 'filters': {
+ },
+ 'handlers': {
+ 'lcm_handler': {
+ 'level': 'DEBUG',
+ 'class': 'logging.handlers.RotatingFileHandler',
+ 'filename': os.path.join(BASE_DIR, 'logs/runtime_lcm.log'),
+ 'formatter': 'standard',
+ 'maxBytes': 1024 * 1024 * 50,
+ 'backupCount': 5,
+ },
+ },
+
+ 'loggers': {
+ 'lcm': {
+ 'handlers': ['lcm_handler'],
+ 'level': 'DEBUG',
+ 'propagate': False
+ },
+ }
+ }
+else:
+ LOGGING_CONFIG = None
+ # yaml configuration of logging
+ LOGGING_FILE = os.path.join(BASE_DIR, 'lcm/log.yml')
+ log_config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
if 'test' in sys.argv:
pub_config.REG_TO_MSB_WHEN_START = False
'NAME': ':memory:',
}
REST_FRAMEWORK = {}
- import platform
if platform.system() == 'Linux':
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
TEST_OUTPUT_VERBOSE = True
TEST_OUTPUT_DESCRIPTIONS = True
TEST_OUTPUT_DIR = 'test-reports'
+
+ import mock
+ from lcm.pub.utils import idutil
+ idutil.get_auto_id = mock.Mock()
+ idutil.get_auto_id.return_value = 1