def test_when_no_name_given(self): result = parse_linkchecker_output(raw_link_checker_output3) self.assertEqual(result[0]["message"], expected_message)
def test_when_no_name_given(self): result = parse_linkchecker_output(raw_link_checker_output3) del result[0]["message"] self.assertEqual(result, [{"url":"http://data-vocabulary.org/Event", "name":None, "parent_url":"parent_url"}])
def test_parse_one_link(self): result = parse_linkchecker_output(raw_link_checker_output) del result[0]["message"] self.assertEqual(result, [{"url":"https://link", "name":"name", "parent_url":"parent_url"}])
def test_no_duplicates(self): result = parse_linkchecker_output(raw_link_checker_output + "\n" +raw_link_checker_output2) del result[0]["message"] self.assertEqual(result, [{"url":"https://link", "name":"name", "parent_url":"parent_url 2"}])
def test_parse_empty_output(self): result = parse_linkchecker_output("") self.assertEqual(result, [])