Skip to content

Commit

Permalink
Add environ vars for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VDigitall committed Nov 1, 2018
1 parent 08ca080 commit 181ab1e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions openprocurement/bridge/basic/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@

from yaml import safe_load


DB_HOST = os.environ.get('DB_HOST', '')
DB_PORT = os.environ.get('DB_PORT', '')
DB_USER = os.environ.get('DB_USER', '')
DB_PASS = os.environ.get('DB_PASS', '')
CONFIG_FILE = "{}/test.yml".format(os.path.dirname(__file__))
with open(CONFIG_FILE, 'r') as f:
TEST_CONFIG = safe_load(f.read())
if DB_HOST:
TEST_CONFIG['main']['storage_config']['host'] = DB_HOST
if DB_PORT:
TEST_CONFIG['main']['storage_config']['port'] = DB_PORT
if DB_USER:
TEST_CONFIG['main']['storage_config']['user'] = DB_USER
if DB_PASS:
TEST_CONFIG['main']['storage_config']['password'] = DB_PASS


class MockedResponse(object):
Expand Down

0 comments on commit 181ab1e

Please sign in to comment.