MCPcopy Index your code
hub / github.com/gitless-vcs/gitless / test_diff_nontracked

Method test_diff_nontracked

gitless/tests/test_core.py:571–587  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

569 UNTRACKED_FP, UNTRACKED_FP_WITH_SPACE,
570 IGNORED_FP, IGNORED_FP_WITH_SPACE)
571 def test_diff_nontracked(self):
572 fps = [
573 UNTRACKED_FP, UNTRACKED_FP_WITH_SPACE,
574 IGNORED_FP, IGNORED_FP_WITH_SPACE]
575 for fp in fps:
576 utils_lib.write_file(fp, contents='new contents')
577 patch = self.curr_b.diff_file(fp)
578
579 self.assertEqual(1, patch.line_stats[1])
580 self.assertEqual(0, patch.line_stats[2])
581
582 self.assertEqual(1, len(patch.hunks))
583 hunk = list(patch.hunks)[0]
584
585 self.assertEqual(2, len(hunk.lines))
586 self.assertEqual('+', hunk.lines[0].origin)
587 self.assertEqual('new contents', hunk.lines[0].content)
588
589 def test_diff_nonexistent_fp(self):
590 self.assertRaises(KeyError, self.curr_b.diff_file, NONEXISTENT_FP)

Callers

nothing calls this directly

Calls 1

diff_fileMethod · 0.80

Tested by

no test coverage detected