MCPcopy
hub / github.com/eudicots/Cactus / test_missing_file

Method test_missing_file

cactus/tests/test_config.py:127–139  ·  view source on GitHub ↗

Test that we don't throw on a missing file, and that the configuration remains in a consistent state.

(self)

Source from the content-addressed store, hash-verified

125 self.assertEqual("canary", f.read())
126
127 def test_missing_file(self):
128 """
129 Test that we don't throw on a missing file, and that the configuration
130 remains in a consistent state.
131 """
132 wrong_path = os.path.join(self.path, "does_not_exist.json")
133
134 self.conf1.set("context", {"k1":"v1"})
135 self.conf1.write()
136
137 router = ConfigRouter([wrong_path, self.path1])
138
139 self.assertEqual(router.get("context").get("k1"), "v1")
140
141 def test_broken_file(self):
142 """

Callers

nothing calls this directly

Calls 5

getMethod · 0.95
ConfigRouterClass · 0.90
setMethod · 0.45
writeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected