Example #1
0
 def test_non_zero_exit_code(self):
     path = "/path"
     reason = "REASON"
     result = check.CheckResult(path, 1, reason, 0, 0)
     with self.assertRaises(exception.MiscFileReadException) as ctx:
         result.delay()
     self.assertIn(path, str(ctx.exception))
     self.assertIn(reason, str(ctx.exception))
Example #2
0
def test_check_result_non_zero_exit_code():
    path = "/path"
    reason = "REASON"
    result = check.CheckResult(path, 1, reason, 0, 0)
    with pytest.raises(exception.MiscFileReadException) as ctx:
        result.delay()
    assert path in str(ctx.value)
    assert reason in str(ctx.value)
Example #3
0
 def test_unexpected_output(self, err):
     result = check.CheckResult("/path", 0, err, 0, 0)
     self.assertRaises(exception.MiscFileReadException, result.delay)
Example #4
0
 def test_success(self, err, seconds):
     result = check.CheckResult("/path", 0, err, 0, 0)
     self.assertEqual(result.delay(), seconds)
Example #5
0
def test_unexpected_output(err):
    result = check.CheckResult("/path", 0, err, 0, 0)
    with pytest.raises(exception.MiscFileReadException):
        result.delay()
Example #6
0
def test_check_result_success(err, seconds):
    result = check.CheckResult("/path", 0, err, 0, 0)
    assert result.delay() == seconds