MCPcopy Create free account
hub / github.com/dbcli/mycli / FakeResourceTree

Class FakeResourceTree

test/pytests/test_main_modes_repl.py:120–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118
119
120class FakeResourceTree:
121 def __init__(self, files: dict[str, str], path: str | None = None) -> None:
122 self.files = files
123 self.path = path
124
125 def joinpath(self, path: str) -> 'FakeResourceTree':
126 return FakeResourceTree(self.files, path)
127
128 def open(self, mode: str) -> StringIO:
129 assert self.path is not None
130 if self.path not in self.files:
131 raise FileNotFoundError(self.path)
132 return StringIO(self.files[self.path])
133
134
135def make_repl_cli(sqlexecute: Any | None = None) -> Any:

Calls

no outgoing calls