Esempio n. 1
0
 def test_fix_duration(self):
     self.assertEqual(Validate.fix_duration('PT1H02M15S'), 135)
     self.assertEqual(Validate.fix_duration('PT02M'), 120)
Esempio n. 2
0
 def test_duration_pass(self):
     response = {'duration': 'PT04M15S'}
     self.assertTrue(Validate.duration(response))
Esempio n. 3
0
 def test_duration_fail(self):
     response = {'duration': 'PT14M15S'}
     self.assertFalse(Validate.duration(response))
Esempio n. 4
0
 def test_channel_fail(self):
     response = {'channelTitle': '7even3hreetv'}
     self.assertFalse(Validate.channel_title(response))
Esempio n. 5
0
 def test_channel_pass(self):
     response = {'channelTitle': 'paramount picture'}
     self.assertTrue(Validate.channel_title(response))
Esempio n. 6
0
 def test_title_fail(self):
     response = {'title': 'Deutsch Trailer'}
     self.assertFalse(Validate.title(response))
Esempio n. 7
0
 def test_title_pass(self):
     response = {'title': 'Trailer'}
     self.assertTrue(Validate.title(response))
Esempio n. 8
0
 def test_region_pass(self):
     response = {}
     self.assertTrue(Validate.region(response))
Esempio n. 9
0
 def test_region_fail(self):
     response = {'regionRestriction': {'blocked': ['GB']}}
     self.assertFalse(Validate.region(response))
Esempio n. 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))
Esempio n. 11
0
 def test_validate_fail_duration(self):
     response = {'snippet': {'channelTitle': 'paramount picture', 'title': 'Trailer'}, 'duration': 'PT14M15S'}
     self.assertFalse(Validate.validate(response))
Esempio n. 12
0
 def test_validate_fail_channel(self):
     response = {'snippet': {'channelTitle': '7even3hreetv', 'title': 'Trailer'}, 'duration': 'PT04M15S'}
     self.assertFalse(Validate.validate(response))