Ejemplo n.º 1
0
    def setUp(self):
        super(TempestLogWrappersTestCase, self).setUp()
        verifier = mock.MagicMock()
        verifier.parse_results.return_value = mock.MagicMock(total={"time": 0},
                                                             tests={})

        context = test.get_test_context()
        context.update({"tmp_results_dir": "/tmp/dir", "verifier": verifier})
        self.scenario = tempest.TempestScenario(context)
        self.scenario._add_atomic_actions = mock.MagicMock()
Ejemplo n.º 2
0
 def setUp(self):
     super(TempestScenarioTestCase, self).setUp()
     self.verifier = verifier.Tempest("fake_uuid")
     self.verifier.log_file_raw = "/dev/null"
     self.verifier.parse_results = mock.MagicMock()
     self.verifier.parse_results.return_value = mock.MagicMock(
         tests={}, total={"time": 0})
     self.context = test.get_test_context()
     self.context.update({"verifier": self.verifier,
                          "tmp_results_dir": "/dev"})
     self.scenario = tempest.TempestScenario(self.context)
     self.scenario._add_atomic_actions = mock.MagicMock()
Ejemplo n.º 3
0
    def setUp(self):
        super(TempestLogWrappersTestCase, self).setUp()
        verifier = mock.MagicMock()
        verifier.parse_results.return_value = ({
            "fake": True
        }, {
            "have_results": True
        })

        context = {"tmp_results_dir": "/tmp/dir", "verifier": verifier}
        self.scenario = tempest.TempestScenario(context)
        self.scenario._add_atomic_actions = mock.MagicMock()
Ejemplo n.º 4
0
 def setUp(self):
     super(TempestScenarioTestCase, self).setUp()
     self.verifier = verifier.Tempest("fake_uuid")
     self.verifier.log_file_raw = "/dev/null"
     self.verifier.parse_results = mock.MagicMock()
     self.verifier.parse_results.return_value = ({
         "fake": True
     }, {
         "have_results": True
     })
     self.context = {"verifier": self.verifier, "tmp_results_dir": "/dev"}
     self.scenario = tempest.TempestScenario(self.context)
     self.scenario._add_atomic_actions = mock.MagicMock()
Ejemplo n.º 5
0
    def test_func_time_result_is_string(self):
        verifier = mock.MagicMock()
        verifier.parse_results.return_value = mock.MagicMock(
            total={"time": "0.1"}, tests={})
        context = test.get_test_context()
        context.update({"tmp_results_dir": "/tmp/dir", "verifier": verifier})
        scenario = tempest.TempestScenario(context)

        target_func = mock.MagicMock()
        target_func.__name__ = "target_func"
        func = utils.tempest_log_wrapper(target_func)

        func(scenario)
        self.assertEqual(0.1, scenario._atomic_actions["test_execution"])