MCPcopy Create free account
hub / github.com/PrefectHQ/fastmcp / test_parse_complex_object

Method test_parse_complex_object

tests/cli/test_run.py:74–87  ·  view source on GitHub ↗

Test parsing file path with complex object specification.

(self, tmp_path)

Source from the content-addressed store, hash-verified

72 assert source.entrypoint == "app"
73
74 def test_parse_complex_object(self, tmp_path):
75 """Test parsing file path with complex object specification."""
76 test_file = tmp_path / "server.py"
77 test_file.write_text("# test server")
78
79 # The implementation splits on the last colon, so file:module:app
80 # becomes file_path="file:module" and entrypoint="app"
81 # We need to create a file with a colon in the name for this test
82 complex_file = tmp_path / "server:module.py"
83 complex_file.write_text("# test server")
84
85 source = FileSystemSource(path=f"{complex_file}:app")
86 assert Path(source.path).resolve() == complex_file.resolve()
87 assert source.entrypoint == "app"
88
89 async def test_load_server_nonexistent(self):
90 """Test loading nonexistent file path exits."""

Callers

nothing calls this directly

Calls 2

FileSystemSourceClass · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected