Skip to content

Commit

Permalink
Merge pull request #7 from openprocurement/ea890504518265828_add_envi…
Browse files Browse the repository at this point in the history
…ron_vars_for_tests

Add environ vars for tests
  • Loading branch information
VDigitall committed Nov 1, 2018
2 parents 08ca080 + 181ab1e commit 99e057c
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 99e057c

Please sign in to comment.