def test_workflows(self): tr = TestRun(self.testConfig) self.assertEqual( tr.get_workflows() , []) tr.add_workflow( "wf1" ) tr.add_workflow( "wf2" ) self.assertEqual( tr.get_workflows() , ["wf1" , "wf2"])
def test_workflows(self): tr = TestRun("test-data/local/run/config.txt") self.assertEqual( tr.get_workflows() , []) tr.add_workflow( "wf1" ) tr.add_workflow( "wf2" ) self.assertEqual( tr.get_workflows() , ["wf1" , "wf2"])
def test_args(self): tr = TestRun("test-data/local/run/config.txt") self.assertEqual( tr.get_args() , []) tr.add_arg("-v") self.assertEqual( tr.get_args() , ["-v"]) tr.add_arg("latest") self.assertEqual( tr.get_args() , ["-v" , "latest"])
def test_check(self): tr = TestRun(self.testConfig , "Name") tr.add_check( path_exists , "some/file" ) with self.assertRaises(Exception): tr.add_check( 25 , "arg") with self.assertRaises(Exception): tr.add_check( func_does_not_exist , "arg")
def test_check(self): tr = TestRun("test-data/local/run/config.txt" , "Name") tr.add_check( path_exists , "some/file" ) with self.assertRaises(Exception): tr.add_check( 25 , "arg") with self.assertRaises(Exception): tr.add_check( func_does_not_exist , "arg")
def test_run_no_workflow(self): tr = TestRun(self.testConfig) with self.assertRaises(Exception): tr.run()
def test_args2(self): tr = TestRun(self.testConfig , args = ["arg1","arg2","-v","latest"]) self.assertEqual( tr.get_args() , ["arg1","arg2"]) self.assertEqual(tr.ert_version , "latest")
def test_cmd(self): tr = TestRun(self.testConfig) self.assertEqual( tr.ert_cmd , TestRun.default_ert_cmd ) tr.ert_cmd = "/tmp/test" self.assertEqual( "/tmp/test" , tr.ert_cmd )
def test_run_no_workflow(self): tr = TestRun("test-data/local/run/config.txt") with self.assertRaises(Exception): tr.run()
def test_cmd(self): tr = TestRun("test-data/local/run/config.txt") self.assertEqual( tr.ert_cmd , TestRun.default_ert_cmd ) tr.ert_cmd = "/tmp/test" self.assertEqual( "/tmp/test" , tr.ert_cmd )