Skip to content

Commit 535b6b7

Browse files
committed
fix: update missed CodebaseGraph rename
1 parent 06661db commit 535b6b7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/unit/codegen/sdk/core/test_directory.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212

1313

1414
@pytest.fixture
15-
def mock_codebase_context(tmp_path):
15+
def mock_codebase_graph(tmp_path):
1616
mock = MagicMock(spec=CodebaseContext)
1717
mock.transaction_manager = MagicMock()
1818
mock.config = CodebaseConfig()
1919
mock.repo_path = tmp_path
2020
mock.to_absolute = types.MethodType(CodebaseContext.to_absolute, mock)
2121
mock.to_relative = types.MethodType(CodebaseContext.to_relative, mock)
22+
mock.io = MagicMock()
2223
return mock
2324

2425

@@ -39,7 +40,7 @@ def sub_dir(subdir_path, tmp_path):
3940

4041
@pytest.fixture
4142
def mock_file(dir_path, mock_codebase_graph):
42-
return File(filepath=dir_path / "example.py", G=mock_codebase_graph)
43+
return File(filepath=dir_path / "example.py", ctx=mock_codebase_graph)
4344

4445

4546
@pytest.fixture
@@ -67,7 +68,7 @@ def test_name_property(mock_directory):
6768

6869
def test_add_and_file(mock_directory, mock_codebase_graph):
6970
"""Test adding a file to the directory."""
70-
mock_file = File(filepath=Path("mock_dir/example_2.py"), G=mock_codebase_graph)
71+
mock_file = File(filepath=Path("mock_dir/example_2.py"), ctx=mock_codebase_graph)
7172
mock_directory.add_file(mock_file)
7273
rel_path = os.path.relpath(mock_file.file_path, mock_directory.dirpath)
7374
assert rel_path in mock_directory.items
@@ -143,7 +144,7 @@ def test_files_property(mock_directory, sub_dir, mock_codebase_graph):
143144
all_files = mock_directory.files
144145
assert len(all_files) == 1
145146

146-
new_file = File(filepath=Path("mock_dir/example_2.py"), G=mock_codebase_graph)
147+
new_file = File(filepath=Path("mock_dir/example_2.py"), ctx=mock_codebase_graph)
147148
sub_dir.add_file(new_file)
148149

149150
all_files = mock_directory.files

0 commit comments

Comments
 (0)