def course_urls(self):
     """ Find the file containing the urls of interests for this course
         and return the parsed results """
     try:
         return parsers.course_urls_parser(self.read_file(self.course_urls_filename, raiseException=True))
     except FileNotFoundError as e:
         strerr = e.args[0]
         raise CourseURLsFileNotFound(strerr)
 def test_multiple_urls_with_label(self):
     content = "{}     \t    google is the site   \t  \n https://moodle.epfl.ch moodle place for everyone ".format(self.SOME_URL)
     expected = [(self.SOME_URL, "google is the site"), ("https://moodle.epfl.ch", "moodle place for everyone")]
     self.assertListEqual(expected, course_urls_parser(content))
 def test_simple_url_with_useless_spaces_in_label(self):
     content = "{}     \t    google is the site   \t    ".format(self.SOME_URL)
     expected = [(self.SOME_URL, "google is the site")]
     self.assertListEqual(expected, course_urls_parser(content))
 def test_simple_url_with_unicode_label(self):
     unicode_label = "هاسكل" # Apparently Haskell in arabic
     content = "{} {}".format(self.SOME_URL, unicode_label)
     expected = [(self.SOME_URL, unicode_label)]
     self.assertListEqual(expected, course_urls_parser(content))
 def test_simple_url_with_multiple_words_label(self):
     content = "{} google is the site".format(self.SOME_URL)
     expected = [(self.SOME_URL, "google is the site")]
     self.assertListEqual(expected, course_urls_parser(content))
 def test_simple_url_with_spaces_in_beginning(self):
     content = "  \t  {}".format(self.SOME_URL)
     expected = [(self.SOME_URL, self.DEFAULT_LABEL)]
     self.assertListEqual(expected, course_urls_parser(content))
 def test_simple_url(self):
     content = "{}".format(self.SOME_URL)
     expected = [(self.SOME_URL, self.DEFAULT_LABEL)]
     self.assertListEqual(expected, course_urls_parser(content))
 def test_empty_content(self):
     content = ""
     expected = []
     self.assertListEqual(expected, course_urls_parser(content))