Exemplo n.º 1
0
 def test_status_string(self):
     c = ChartResult(name="railed-result",
                     failed=True,
                     error_reason="",
                     response=None)
     self.assertEqual(c.status_string, "Failed")
     c.failed = False
     self.assertEqual(c.status_string, "Succeeded")
Exemplo n.º 2
0
 def test_string_output(self):
     c = ChartResult(name="fake-result",
                     failed=False,
                     error_reason="oops",
                     response=None)
     string_output = c.__str__()
     self.assertIn("fake-result", string_output)
     self.assertIn("Succeeded", string_output)
     self.assertIn(c.error_reason, string_output)
Exemplo n.º 3
0
    def test_results_with_errors(self):
        r = ReckonerInstallResults()
        r.add_result(
            ChartResult(name="good-result", failed=False, error_reason=""))
        r.add_result(
            ChartResult(name="failed",
                        failed=True,
                        error_reason="failed install"))

        self.assertEqual(len(r.results_with_errors), 1)
Exemplo n.º 4
0
    def test_has_errors(self):
        r = ReckonerInstallResults()
        r.add_result(
            ChartResult(name="fake-result", failed=False, error_reason=""))
        self.assertFalse(r.has_errors)

        r = ReckonerInstallResults()
        r.add_result(
            ChartResult(name="failed-result",
                        failed=True,
                        error_reason="somereason"))
        self.assertTrue(r.has_errors)
Exemplo n.º 5
0
    def test_initialize(self):
        c = ChartResult(name="fake-result",
                        failed=False,
                        error_reason="",
                        response=None)

        assert c