Example #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")
Example #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)
Example #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)
Example #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)
Example #5
0
    def test_initialize(self):
        c = ChartResult(name="fake-result",
                        failed=False,
                        error_reason="",
                        response=None)

        assert c