def test_validate(self): self.assertRaises( FilterValidationError, OffHour({'default_tz': 'zmta'}).validate) self.assertRaises( FilterValidationError, OffHour({'offhour': 25}).validate) i = OffHour({}) self.assertEqual(i.validate(), i)
def test_validate(self): url_test = 's3://test-dest/holidays.csv' self.assertRaises( FilterValidationError, OffHour({'default_tz': 'zmta'}).validate) self.assertRaises( FilterValidationError, OffHour({'offhour': 25}).validate) self.assertRaises( FilterValidationError, OffHour({'skip-days': ['2017-01-01'], 'skip-days-from': {'expr': 0, 'format': 'csv', 'url': url_test}}).validate) i = OffHour({}) self.assertEqual(i.validate(), i)
def test_validate(self): url_test = "s3://test-dest/holidays.csv" self.assertRaises( PolicyValidationError, OffHour({"default_tz": "zmta"}).validate ) self.assertRaises(PolicyValidationError, OffHour({"offhour": 25}).validate) self.assertRaises( PolicyValidationError, OffHour( { "skip-days": ["2017-01-01"], "skip-days-from": {"expr": 0, "format": "csv", "url": url_test}, } ).validate, ) i = OffHour({}) self.assertEqual(i.validate(), i)
def test_validate(self): url_test = 's3://test-dest/holidays.csv' self.assertRaises(FilterValidationError, OffHour({ 'default_tz': 'zmta' }).validate) self.assertRaises(FilterValidationError, OffHour({ 'offhour': 25 }).validate) self.assertRaises( FilterValidationError, OffHour({ 'skip-days': ['2017-01-01'], 'skip-days-from': { 'expr': 0, 'format': 'csv', 'url': url_test } }).validate) i = OffHour({}) self.assertEqual(i.validate(), i)