Beispiel #1
0
    def test_init(self):
        with self.assertRaises(IOError):
            TestRun("Does/notExist")

        tr = TestRun(self.testConfig)
        self.assertEqual(tr.config_file, os.path.split(self.testConfig)[1])
        self.assertEqual(tr.ert_version, "stable")
Beispiel #2
0
 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"])
Beispiel #3
0
    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")
Beispiel #4
0
    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")
Beispiel #5
0
    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"])
Beispiel #6
0
 def test_runpath(self):
     tr = TestRun(self.testConfig, "Name")
     self.assertEqual(TestRun.default_path_prefix, tr.path_prefix)
Beispiel #7
0
 def test_run_no_workflow(self):
     tr = TestRun(self.testConfig)
     with self.assertRaises(Exception):
         tr.run()
Beispiel #8
0
 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")
Beispiel #9
0
    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)
Beispiel #10
0
 def test_args(self):
     tr = TestRun(self.testConfig, args=["-v", "latest"])
     self.assertEqual(tr.ert_version, "latest")
Beispiel #11
0
 def test_run_no_workflow(self):
     tr = TestRun(self.testConfig)
     with self.assertRaises(Exception):
         tr.run()
Beispiel #12
0
 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")
Beispiel #13
0
    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 )