Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added repo-mapper/README.md
Empty file.
Empty file added repo-mapper/mapper.py
Empty file.
Empty file added repo-mapper/requirements.txt
Empty file.
23 changes: 23 additions & 0 deletions repo-mapper/tests/test_mapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest
import os
from mapper import analyze_file

def test_analyze_simple_code(tmp_path):
# Create a temporary python file
d = tmp_path / "sub"
d.mkdir()
p = d / "hello.py"
p.write_text("class MyClass:\n def my_method(self):\n pass\n\ndef my_function():\n pass")

results = analyze_file(str(p))

assert "MyClass" in results["classes"]
assert "my_method" in results["functions"]
assert "my_function" in results["functions"]

def test_ignore_private_methods(tmp_path):
p = tmp_path / "private.py"
p.write_text("def _hidden():\n pass")

results = analyze_file(str(p))
assert "_hidden" not in results["functions"]