Beispiel #1
0
    def test_renders_markdown_readme(self):
        readme = Readme("This is a *<README>*.", "README.md")
        self.assertEqual("<p>This is a <em>&lt;README&gt;</em>.</p>",
                         readme.render())

        readme = Readme("This is a *<README>*.", "readme.MD")
        self.assertEqual("<p>This is a <em>&lt;README&gt;</em>.</p>",
                         readme.render())
Beispiel #2
0
    def test_infers_format_from_filename(self):
        readme = Readme("This is a README.", "README")
        self.assertEqual(Readme.Format.TEXT, readme.format)

        readme = Readme("This is a README.", "README.md")
        self.assertEqual(Readme.Format.MARKDOWN, readme.format)

        readme = Readme("This is a README.", "README.jp.md")
        self.assertEqual(Readme.Format.MARKDOWN, readme.format)

        readme = Readme("This is a README.", "README.md.jp")
        self.assertEqual(Readme.Format.TEXT, readme.format)

        readme = Readme("This is a CHANGELOG.", "CHANGELOG")
        self.assertEqual(Readme.Format.TEXT, readme.format)

        readme = Readme("This is a CHANGELOG.", "CHANGELOG.md")
        self.assertEqual(Readme.Format.MARKDOWN, readme.format)

        readme = Readme("This is a CHANGELOG.", "CHANGELOG.fr.md")
        self.assertEqual(Readme.Format.MARKDOWN, readme.format)

        readme = Readme("This is a CHANGELOG.", "CHANGELOG.md.fr")
        self.assertEqual(Readme.Format.TEXT, readme.format)
Beispiel #3
0
 def test_wraps_plain_text_readme_in_pre(self):
     readme = Readme("This is a *<README>*.", "README")
     self.assertEqual("<pre>This is a *&lt;README&gt;*.</pre>",
                      readme.render())