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

Method test_dirty

cactus/tests/test_config.py:111–125  ·  view source on GitHub ↗

Test that we don't re-write files that we haven't changed

(self)

Source from the content-addressed store, hash-verified

109 self.assertEqual(context.get("k2"), "v2")
110
111 def test_dirty(self):
112 """
113 Test that we don't re-write files that we haven't changed
114 """
115
116 self.conf1.set("a", "b")
117 self.conf1.write()
118
119 with open(self.path1, "w") as f:
120 f.write("canary")
121
122 self.conf1.write()
123
124 with open(self.path1) as f:
125 self.assertEqual("canary", f.read())
126
127 def test_missing_file(self):
128 """

Callers

nothing calls this directly

Calls 3

readMethod · 0.80
setMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected