Skip to content

Commit

Permalink
added datadir argument to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coleslaw481 committed Jul 9, 2019
1 parent 0e53545 commit 3be9f8b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_ndexloadstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ def tearDown(self):

def test_parse_arguments(self):
"""Tests parse arguments"""
res = ndexloadstring._parse_arguments('description', [])
res = ndexloadstring._parse_arguments('description', ['datadir'])

self.assertEqual(res.profile, 'ndexstringloader')
self.assertEqual(res.verbose, 0)
self.assertEqual(res.logconf, None)
self.assertEqual(res.conf, None)

someargs = ['-vv', '--conf', 'foo', '--logconf', 'hi',
'--profile', 'myprofy', '--stringversion', '1.0']
'--profile', 'myprofy', '--stringversion', '1.0',
'datadir']
res = ndexloadstring._parse_arguments('description', someargs)

self.assertEqual(res.profile, 'myprofy')
Expand All @@ -49,7 +50,7 @@ def test_setup_logging(self):
pass

# args.logconf is None
res = ndexloadstring._parse_arguments('hi', [])
res = ndexloadstring._parse_arguments('hi', ['datadir'])
ndexloadstring._setup_logging(res)

# args.logconf set to a file
Expand Down Expand Up @@ -81,7 +82,8 @@ def test_setup_logging(self):
format=%(asctime)s %(name)-12s %(levelname)-8s %(message)s""")

res = ndexloadstring._parse_arguments('hi', ['--logconf',
logfile])
logfile,
'datadir'])
ndexloadstring._setup_logging(res)

finally:
Expand All @@ -103,7 +105,7 @@ def test_main(self):
server=NDExUtilConfig.SERVER))
res = ndexloadstring.main(['myprog.py', '--conf',
confile, '--profile',
'hi'])
'hi', 'datadir'])
self.assertEqual(2, res)
finally:
shutil.rmtree(temp_dir)

0 comments on commit 3be9f8b

Please sign in to comment.