示例#1
0
 def test__parse_course_id_from_string(self):
     """
     Tests the _parse_course_id_from_string util function
     """
     course_id = u'org/num/run'                                # pylint: disable=C0103
     COURSE_URL = u'/courses/{}/otherstuff'.format(course_id)  # pylint: disable=C0103
     NON_COURSE_URL = u'/blahblah'                             # pylint: disable=C0103
     self.assertEqual(_parse_course_id_from_string(COURSE_URL), course_id)
     self.assertIsNone(_parse_course_id_from_string(NON_COURSE_URL))
示例#2
0
 def test__parse_course_id_from_string(self):
     """
     Tests the _parse_course_id_from_string util function
     """
     COURSE_ID = u'org/num/run'  # pylint: disable=C0103
     COURSE_URL = u'/courses/{}/otherstuff'.format(COURSE_ID)  # pylint: disable=C0103
     NON_COURSE_URL = u'/blahblah'  # pylint: disable=C0103
     self.assertEqual(_parse_course_id_from_string(COURSE_URL), COURSE_ID)
     self.assertIsNone(_parse_course_id_from_string(NON_COURSE_URL))
示例#3
0
 def test__parse_course_id_from_string(self):
     """
     Tests the _parse_course_id_from_string util function
     """
     COURSE_ID = u"org/num/run"  # pylint: disable=C0103
     COURSE_URL = u"/courses/{}/otherstuff".format(COURSE_ID)  # pylint: disable=C0103
     NON_COURSE_URL = u"/blahblah"  # pylint: disable=C0103
     self.assertEqual(
         _parse_course_id_from_string(COURSE_URL), SlashSeparatedCourseKey.from_deprecated_string(COURSE_ID)
     )
     self.assertIsNone(_parse_course_id_from_string(NON_COURSE_URL))
示例#4
0
 def test__parse_course_id_from_string(self):
     """
     Tests the _parse_course_id_from_string util function
     """
     COURSE_ID = u'org/num/run'  # pylint: disable=invalid-name
     COURSE_URL = u'/courses/{}/otherstuff'.format(COURSE_ID)  # pylint: disable=invalid-name
     NON_COURSE_URL = u'/blahblah'  # pylint: disable=invalid-name
     self.assertEqual(
         _parse_course_id_from_string(COURSE_URL),
         SlashSeparatedCourseKey.from_deprecated_string(COURSE_ID))
     self.assertIsNone(_parse_course_id_from_string(NON_COURSE_URL))
示例#5
0
 def test__parse_course_id_from_string(self):
     """
     Tests the _parse_course_id_from_string util function
     """
     COURSE_ID = u'org/num/run'                                # pylint: disable=invalid-name
     COURSE_URL = u'/courses/{}/otherstuff'.format(COURSE_ID)  # pylint: disable=invalid-name
     NON_COURSE_URL = u'/blahblah'                             # pylint: disable=invalid-name
     self.assertEqual(
         _parse_course_id_from_string(COURSE_URL),
         SlashSeparatedCourseKey.from_deprecated_string(COURSE_ID)
     )
     self.assertIsNone(_parse_course_id_from_string(NON_COURSE_URL))