예제 #1
0
    def test_validate_backup_window(self):
        good_windows = ("10:00-11:00", "22:00-06:00")
        for w in good_windows:
            rds.validate_backup_window(w)

        bad_format = ("bad_backup_window", "28:11-10:00", "10:00-28:11")
        for w in bad_format:
            with self.assertRaisesRegexp(ValueError, "must be in the format"):
                rds.validate_backup_window(w)

        with self.assertRaisesRegexp(ValueError, "must be at least 30 "):
            rds.validate_backup_window("10:00-10:10")
예제 #2
0
    def test_validate_backup_window(self):
        good_windows = ("10:00-11:00", "22:00-06:00")
        for w in good_windows:
            rds.validate_backup_window(w)

        bad_format = ("bad_backup_window", "28:11-10:00", "10:00-28:11")
        for w in bad_format:
            with self.assertRaisesRegexp(ValueError, "must be in the format"):
                rds.validate_backup_window(w)

        with self.assertRaisesRegexp(ValueError, "must be at least 30 "):
            rds.validate_backup_window("10:00-10:10")