From 4e1644def9508d87cf12a39045ede749d82c9811 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Sun, 1 Oct 2023 01:12:48 +0200 Subject: [PATCH] Issue #45: Get the real package name from Pypi before request it (new tests). --- tests/sources/test_sourcecode_page.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/sources/test_sourcecode_page.py b/tests/sources/test_sourcecode_page.py index 3e3d4c3..7ffce2d 100644 --- a/tests/sources/test_sourcecode_page.py +++ b/tests/sources/test_sourcecode_page.py @@ -7,6 +7,7 @@ get_github_readme, search_in_readme, SourcecodePage, + replace_chars, ) @@ -55,6 +56,17 @@ def test_get_github_readme( ) +class TestReplaceChars(unittest.TestCase): + """Test the replace_chars function.""" + + def test_replace_chars(self): + """Test the replace_chars function.""" + with self.subTest("Test with dash char"): + self.assertEqual("package-name123", replace_chars("package-name123")) + with self.subTest("Test with other chars"): + self.assertEqual("package-name-123", replace_chars("package_name.123")) + + class TestSearchInReadme(unittest.TestCase): """Test the search_in_readme function."""