def test_bad_name(self):
     with self.assertRaises(LogRotateError):
         # log3 has a completely invalid name, and thus should cause an
         # exception.
         check_expected_backup("log3", "unit-fill-logs-0", big_obj)
 def test_too_big(self):
     with self.assertRaises(LogRotateError):
         # log1 is too big, and thus should cause an exception.
         check_expected_backup("log1", "unit-fill-logs-0", big_obj)
 def test_bad_timestamp(self):
     with self.assertRaises(LogRotateError):
         # log2 has an invalid timestamp, and thus should cause an
         # exception.
         check_expected_backup("log2", "unit-fill-logs-0", big_obj)
 def test_exists(self):
     try:
         # log1 should be found, and thus no exception.
         check_expected_backup("log1", "unit-fill-logs-0", good_obj)
     except Exception as e:
         self.fail("unexpected exception: %s" % e.msg)
 def test_not_found(self):
     with self.assertRaises(LogRotateError):
         # log2 should not be found, and thus cause an exception.
         check_expected_backup("log2", "unit-fill-logs-0", good_obj)
示例#6
0
 def test_bad_name(self):
     with self.assertRaises(LogRotateError):
         # log3 has a completely invalid name, and thus should cause an
         # exception.
         check_expected_backup("log3", "unit-fill-logs-0", big_obj)
示例#7
0
 def test_bad_timestamp(self):
     with self.assertRaises(LogRotateError):
         # log2 has an invalid timestamp, and thus should cause an
         # exception.
         check_expected_backup("log2", "unit-fill-logs-0", big_obj)
示例#8
0
 def test_too_big(self):
     with self.assertRaises(LogRotateError):
         # log1 is too big, and thus should cause an exception.
         check_expected_backup("log1", "unit-fill-logs-0", big_obj)
示例#9
0
 def test_not_found(self):
     with self.assertRaises(LogRotateError):
         # log2 should not be found, and thus cause an exception.
         check_expected_backup("log2", "unit-fill-logs-0", good_obj)
示例#10
0
 def test_exists(self):
     try:
         # log1 should be found, and thus no exception.
         check_expected_backup("log1", "unit-fill-logs-0", good_obj)
     except Exception as e:
         self.fail("unexpected exception: %s" % e.msg)