Пример #1
0
 def test_fix_duration(self):
     self.assertEqual(Validate.fix_duration('PT1H02M15S'), 135)
     self.assertEqual(Validate.fix_duration('PT02M'), 120)
Пример #2
0
 def test_duration_pass(self):
     response = {'duration': 'PT04M15S'}
     self.assertTrue(Validate.duration(response))
Пример #3
0
 def test_duration_fail(self):
     response = {'duration': 'PT14M15S'}
     self.assertFalse(Validate.duration(response))
Пример #4
0
 def test_channel_fail(self):
     response = {'channelTitle': '7even3hreetv'}
     self.assertFalse(Validate.channel_title(response))
Пример #5
0
 def test_channel_pass(self):
     response = {'channelTitle': 'paramount picture'}
     self.assertTrue(Validate.channel_title(response))
Пример #6
0
 def test_title_fail(self):
     response = {'title': 'Deutsch Trailer'}
     self.assertFalse(Validate.title(response))
Пример #7
0
 def test_title_pass(self):
     response = {'title': 'Trailer'}
     self.assertTrue(Validate.title(response))
Пример #8
0
 def test_region_pass(self):
     response = {}
     self.assertTrue(Validate.region(response))
Пример #9
0
 def test_region_fail(self):
     response = {'regionRestriction': {'blocked': ['GB']}}
     self.assertFalse(Validate.region(response))
Пример #10
0
 def test_validate_fail_region(self):
     response = {'snippet': {'channelTitle': 'paramount picture', 'title': 'Trailer'}, 'duration': 'PT14M15S',
                 'regionRestriction': {'blocked': ['GB']}}
     self.assertFalse(Validate.validate(response))
Пример #11
0
 def test_validate_fail_duration(self):
     response = {'snippet': {'channelTitle': 'paramount picture', 'title': 'Trailer'}, 'duration': 'PT14M15S'}
     self.assertFalse(Validate.validate(response))
Пример #12
0
 def test_validate_fail_channel(self):
     response = {'snippet': {'channelTitle': '7even3hreetv', 'title': 'Trailer'}, 'duration': 'PT04M15S'}
     self.assertFalse(Validate.validate(response))