コード例 #1
0
 def testRunWithDiff(self):
     self.__outContent = "abc"
     with DisposableDirectory("testdir", True) as dir:
         runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncDifferentResults(d,a), "basebin", "testbin", dir.name())
         (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
         self.assertFalse(result)
         self.assertEqual(message, "Test outputs differ")
コード例 #2
0
 def testSuccessfullRun(self):
     with DisposableDirectory("testdir", True) as dir:
         runner = depthmaprunner.DepthmapRegressionRunner(
             lambda d, a: self.runfuncSucceedAlwaysSame(d, a), "basebin",
             "testbin", dir.name())
         (result, message) = runner.runTestCase(
             "testname",
             self.makeCommand("infile.graph", "outfile.graph",
                              "visibility"))
         self.assertTrue(result)
コード例 #3
0
 def testTestRunFail(self):
     with DisposableDirectory("testdir", True) as dir:
         runner = depthmaprunner.DepthmapRegressionRunner(
             lambda d, a: self.runfuncFail(d, a, "testbin", True),
             "basebin", "testbin", dir.name())
         (result, message) = runner.runTestCase(
             "testname",
             self.makeCommand("infile.graph", "outfile.graph",
                              "visibility"))
         self.assertFalse(result)
         self.assertEqual(message, "Test run failed")
コード例 #4
0
 def testTestRunOutputMissing(self):
     with DisposableDirectory("testdir", True) as dir:
         runner = depthmaprunner.DepthmapRegressionRunner(
             lambda d, a: self.runfuncWriteNoFile(d, a, "testbin"),
             "basebin", "testbin", dir.name())
         (result, message) = runner.runTestCase(
             "testname",
             self.makeCommand("infile.graph", "outfile.graph",
                              "visibility"))
         self.assertFalse(result)
         self.assertEqual(
             message, "Test output {0} does not exist".format(
                 os.path.join(dir.name(), "testname" + "_test",
                              "outfile.graph")))