Skip to content

Commit

Permalink
Adapt tests to the argparse changes
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Jun 6, 2018
1 parent 3053beb commit a120b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions rebench/tests/executor_test.py
Expand Up @@ -39,7 +39,7 @@ def setUp(self):
def test_setup_and_run_benchmark(self):
# before executing the benchmark, we override stuff in subprocess for testing
subprocess.Popen = Popen_override
options = ReBench().shell_options().parse_args([])[0]
options = ReBench().shell_options().parse_args(['dummy'])

cnf = Configurator(self._path + '/test.conf', DataStore(), options,
None, 'Test', standard_data_file = self._tmp_file)
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_exit(val):
sys.exit = test_exit

try:
options = ReBench().shell_options().parse_args([])[0]
options = ReBench().shell_options().parse_args(['dummy'])
cnf = Configurator(self._path + '/test.conf', DataStore(), options,
None, 'TestBrokenCommandFormat',
standard_data_file=self._tmp_file)
Expand All @@ -85,7 +85,7 @@ def test_exit(val):
sys.exit = test_exit

try:
options = ReBench().shell_options().parse_args([])[0]
options = ReBench().shell_options().parse_args(['dummy'])
cnf = Configurator(self._path + '/test.conf', DataStore(), options,
None, 'TestBrokenCommandFormat2',
standard_data_file=self._tmp_file)
Expand Down
5 changes: 3 additions & 2 deletions rebench/tests/features/issue_34_accept_faulty_runs_test.py
Expand Up @@ -48,10 +48,11 @@ def test_faulty_runs_rejected_without_switch(self):
self.assertEqual(0, runs[2].get_number_of_data_points())

def test_parse_command_switch(self):
options = ReBench().shell_options().parse_args(["--faulty"])[0]
options = ReBench().shell_options().parse_args(
["--faulty", "test.conf"])
self.assertTrue(options.include_faulty)

options = ReBench().shell_options().parse_args([])[0]
options = ReBench().shell_options().parse_args(["test.conf"])
self.assertFalse(options.include_faulty)

def test_faulty_runs_accepted_with_switch(self):
Expand Down

0 comments on commit a120b37

Please sign in to comment.