

def test_validate_maintenance_window(self):
    good_windows = ('Mon:10:00-Mon:16:30', 'Mon:10:00-Wed:10:00', 'Sun:16:00-Mon:11:00')
    for w in good_windows:
        rds.validate_maintenance_window(w)
    bad_format = ('bad_mainteance', 'Mon:10:00-Tue:28:00', '10:00-22:00')
    for w in bad_format:
        with self.assertRaisesRegexp(ValueError, 'must be in the format'):
            rds.validate_maintenance_window(w)
    bad_days = ('Boo:10:00-Woo:10:30', 'Boo:10:00-Tue:10:30', 'Mon:10:00-Boo:10:30')
    for w in bad_days:
        with self.assertRaisesRegexp(ValueError, ' day part of ranges '):
            rds.validate_maintenance_window(w)
    with self.assertRaisesRegexp(ValueError, 'must be at least 30 '):
        rds.validate_maintenance_window('Mon:10:00-Mon:10:10')

dataset/ETHPy150Open cloudtools/troposphere/tests/test_rds.py TestRDSValidators.test_validate_maintenance_window/original