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."""