def test_fix_duration(self): self.assertEqual(Validate.fix_duration('PT1H02M15S'), 135) self.assertEqual(Validate.fix_duration('PT02M'), 120)
def test_duration_pass(self): response = {'duration': 'PT04M15S'} self.assertTrue(Validate.duration(response))
def test_duration_fail(self): response = {'duration': 'PT14M15S'} self.assertFalse(Validate.duration(response))
def test_channel_fail(self): response = {'channelTitle': '7even3hreetv'} self.assertFalse(Validate.channel_title(response))
def test_channel_pass(self): response = {'channelTitle': 'paramount picture'} self.assertTrue(Validate.channel_title(response))
def test_title_fail(self): response = {'title': 'Deutsch Trailer'} self.assertFalse(Validate.title(response))
def test_title_pass(self): response = {'title': 'Trailer'} self.assertTrue(Validate.title(response))
def test_region_pass(self): response = {} self.assertTrue(Validate.region(response))
def test_region_fail(self): response = {'regionRestriction': {'blocked': ['GB']}} self.assertFalse(Validate.region(response))
def test_validate_fail_region(self): response = {'snippet': {'channelTitle': 'paramount picture', 'title': 'Trailer'}, 'duration': 'PT14M15S', 'regionRestriction': {'blocked': ['GB']}} self.assertFalse(Validate.validate(response))
def test_validate_fail_duration(self): response = {'snippet': {'channelTitle': 'paramount picture', 'title': 'Trailer'}, 'duration': 'PT14M15S'} self.assertFalse(Validate.validate(response))
def test_validate_fail_channel(self): response = {'snippet': {'channelTitle': '7even3hreetv', 'title': 'Trailer'}, 'duration': 'PT04M15S'} self.assertFalse(Validate.validate(response))