@@ -64,12 +64,19 @@ def test_syntax_error_returns_empty(self):
6464class TestGetLibPaths (unittest .TestCase ):
6565 """Tests for get_lib_paths function."""
6666
67- def test_known_dependency (self ):
68- """Test library with known dependencies."""
69- paths = get_lib_paths ("datetime" , "cpython" )
70- self .assertEqual (len (paths ), 2 )
71- self .assertIn (pathlib .Path ("cpython/Lib/datetime.py" ), paths )
72- self .assertIn (pathlib .Path ("cpython/Lib/_pydatetime.py" ), paths )
67+ def test_auto_detect_py_module (self ):
68+ """Test auto-detection of _py{module}.py pattern."""
69+ with tempfile .TemporaryDirectory () as tmpdir :
70+ tmpdir = pathlib .Path (tmpdir )
71+ lib_dir = tmpdir / "Lib"
72+ lib_dir .mkdir ()
73+ (lib_dir / "datetime.py" ).write_text ("# datetime" )
74+ (lib_dir / "_pydatetime.py" ).write_text ("# _pydatetime" )
75+
76+ paths = get_lib_paths ("datetime" , str (tmpdir ))
77+ self .assertEqual (len (paths ), 2 )
78+ self .assertIn (tmpdir / "Lib" / "datetime.py" , paths )
79+ self .assertIn (tmpdir / "Lib" / "_pydatetime.py" , paths )
7380
7481 def test_default_file (self ):
7582 """Test default to .py file."""
0 commit comments