Esempio n. 1
0
 def test_parse_youtube_key_format(self):
     """
     Make sure that inconsistent speed keys are parsed correctly.
     """
     youtube_str = '1.00:p2Q6BrNhdh8'
     youtube_str_hack = '1.0:p2Q6BrNhdh8'
     self.assertEqual(_parse_youtube(youtube_str), _parse_youtube(youtube_str_hack))
Esempio n. 2
0
 def test_parse_youtube_key_format(self):
     """
     Make sure that inconsistent speed keys are parsed correctly.
     """
     youtube_str = '1.00:p2Q6BrNhdh8'
     youtube_str_hack = '1.0:p2Q6BrNhdh8'
     self.assertEqual(_parse_youtube(youtube_str),
                      _parse_youtube(youtube_str_hack))
Esempio n. 3
0
 def test_parse_youtube(self):
     """Test parsing old-style Youtube ID strings into a dict."""
     youtube_str = '0.75:jNCf2gIqpeE,1.00:ZwkTiUPN0mg,1.25:rsq9auxASqI,1.50:kMyNdzVHHgg'
     output = _parse_youtube(youtube_str)
     self.assertEqual(output, {'0.75': 'jNCf2gIqpeE',
                               '1.00': 'ZwkTiUPN0mg',
                               '1.25': 'rsq9auxASqI',
                               '1.50': 'kMyNdzVHHgg'})
Esempio n. 4
0
 def test_parse_youtube_empty(self):
     """
     Some courses have empty youtube attributes, so we should handle
     that well.
     """
     self.assertEqual(_parse_youtube(''),
                      {'0.75': '',
                       '1.00': '',
                       '1.25': '',
                       '1.50': ''})
Esempio n. 5
0
 def test_parse_youtube(self):
     """Test parsing old-style Youtube ID strings into a dict."""
     youtube_str = '0.75:jNCf2gIqpeE,1.00:ZwkTiUPN0mg,1.25:rsq9auxASqI,1.50:kMyNdzVHHgg'
     output = _parse_youtube(youtube_str)
     self.assertEqual(
         output, {
             '0.75': 'jNCf2gIqpeE',
             '1.00': 'ZwkTiUPN0mg',
             '1.25': 'rsq9auxASqI',
             '1.50': 'kMyNdzVHHgg'
         })
Esempio n. 6
0
 def test_parse_youtube_empty(self):
     """
     Some courses have empty youtube attributes, so we should handle
     that well.
     """
     self.assertEqual(_parse_youtube(''), {
         '0.75': '',
         '1.00': '',
         '1.25': '',
         '1.50': ''
     })
Esempio n. 7
0
 def test_parse_youtube_one_video(self):
     """
     Ensure that all keys are present and missing speeds map to the
     empty string.
     """
     youtube_str = '0.75:jNCf2gIqpeE'
     output = _parse_youtube(youtube_str)
     self.assertEqual(output, {'0.75': 'jNCf2gIqpeE',
                               '1.00': '',
                               '1.25': '',
                               '1.50': ''})
Esempio n. 8
0
 def test_parse_youtube_one_video(self):
     """
     Ensure that all keys are present and missing speeds map to the
     empty string.
     """
     youtube_str = '0.75:jNCf2gIqpeE'
     output = _parse_youtube(youtube_str)
     self.assertEqual(output, {
         '0.75': 'jNCf2gIqpeE',
         '1.00': '',
         '1.25': '',
         '1.50': ''
     })