Skip to content

Commit

Permalink
add test for init stub config and then load it
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcasey committed Mar 13, 2017
1 parent bfb4098 commit 6522545
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rcm_nexus/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,18 @@ def init_config():
conf_path = get_config_path()
conf_dir = os.path.dirname(conf_path)
os.makedirs(conf_dir)

user = os.environ.get('USER') or 'someuser'

conf = {
'prod':{
URL: 'http://prod.nexus.corp.com/nexus',
USERNAME: os.environ['USER'] or 'someuser',
USERNAME: user,
PASSWORD: '@oracle:eval:pass rcm-nexus-prod',
},
'stage':{
URL: 'http://stage.nexus.corp.com/nexus',
USERNAME: os.environ['USER'] or 'someuser',
USERNAME: user,
PASSWORD: '@oracle:eval:pass rcm-nexus-stage',
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

class TestConfigLoad(NexupBaseTest):

def test_init(self):
config_file = config.init_config()
config.load('prod')

def test_minimal_from_default(self):
url='http://nowhere.com/nexus'
data={
Expand Down

0 comments on commit 6522545

Please sign in to comment.