diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 10b9cca16..7d1c4e752 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -1168,21 +1168,21 @@ class TestMain(TestCase): test_file = Path(self.tempdir) / "test-model-metadata.json" test_resource_models = { "special-model": { - "max_input_tokens": 8192, - "litellm_provider": "resource-provider", - "mode": "chat" + "max_input_tokens": 8192, + "litellm_provider": "resource-provider", + "mode": "chat", } } test_file.write_text(json.dumps(test_resource_models)) - + # Create a mock for the resource file path mock_resource_path = MagicMock() mock_resource_path.__str__.return_value = str(test_file) - + # Create a mock for the files function that returns an object with joinpath mock_files = MagicMock() mock_files.joinpath.return_value = mock_resource_path - + with patch("aider.main.importlib_resources.files", return_value=mock_files): # Capture stdout to check the output with patch("sys.stdout", new_callable=StringIO) as mock_stdout: @@ -1192,7 +1192,7 @@ class TestMain(TestCase): output=DummyOutput(), ) output = mock_stdout.getvalue() - + # Check that the resource model appears in the output self.assertIn("resource-provider/special-model", output)