MCPcopy Create free account
hub / github.com/MemTensor/MemOS / test_from_json_file

Function test_from_json_file

tests/configs/test_base.py:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def test_from_json_file():
26 data = {"name": "from_file", "value": 42}
27 with tempfile.NamedTemporaryFile(mode="w+", delete=False, suffix=".json") as tmp:
28 json.dump(data, tmp)
29 tmp_path = tmp.name
30
31 config = DummyConfig.from_json_file(tmp_path)
32 assert config.name == "from_file"
33 assert config.value == 42
34 os.remove(tmp_path)
35
36
37def test_to_json_file():

Callers

nothing calls this directly

Calls 2

from_json_fileMethod · 0.80
dumpMethod · 0.45

Tested by

no test coverage detected