MCPcopy
hub / github.com/deadc0de6/dotdrop / test_show_diff_before_write

Method test_show_diff_before_write

tests/test_misc.py:162–182  ·  view source on GitHub ↗

coverage for _show_diff_before_write

(self)

Source from the content-addressed store, hash-verified

160 """test case"""
161
162 def test_show_diff_before_write(self):
163 """coverage for _show_diff_before_write"""
164 inst = Installer()
165
166 tmpdir = get_tempdir()
167 self.addCleanup(clean, tmpdir)
168
169 path1, _ = create_random_file(tmpdir, content='left')
170 path2, _ = create_random_file(tmpdir, content='right')
171 self.assertIsNotNone(inst._show_diff_before_write(
172 path1,
173 path2,
174 content=b'blah'
175 ))
176
177 path3, _ = create_random_file(tmpdir, content='left')
178 path4, _ = create_random_file(tmpdir, content='left')
179 self.assertEqual(inst._show_diff_before_write(
180 path3,
181 path4,
182 ), '')
183
184 def test_show_diff(self):
185 """coverage for _print_diff"""

Callers

nothing calls this directly

Calls 4

InstallerClass · 0.90
get_tempdirFunction · 0.90
create_random_fileFunction · 0.90

Tested by

no test coverage detected