def test_dont_throw_on_non_content_file(self): path = 'some/path/chapter/topics/articleId/en.txt' parse_file_path(path)
def test_can_handle_titles_with_period(self): path = 'some/path/chapter/topics/articleId/en.article.name.with.periods.md' parsed_path = parse_file_path(path) self.assertEqual(parsed_path.title, 'article.name.with.periods')
def test_throw_if_filename_contains_empty_article_name(self): path = 'some/path/chapter/topics/articleId/en..md' with self.assertRaisesMessage(exceptions.ValidationError, 'en..md: Invalid file name'): parse_file_path(path)
def setUp(self): self.path = 'some/path/chapter_6_education/topics/To_learn_english/fr.Apprendre l\'anglais.md' self.parsed_path = parse_file_path(self.path)