def test_from_line_returns_correct_entry_for_custom_patch_status(self): entry = IndexEntry.from_line('P file.txt') self.assertEqual(entry.status, 'P') self.assertEqual(entry.file, 'file.txt')
def test_from_line_ignores_case_of_status(self): entry = IndexEntry.from_line('a file.txt') self.assertEqual(entry.status, 'A') self.assertEqual(entry.file, 'file.txt')
def test_from_line_returns_correct_entry_for_untracked_file_git_format(self): entry = IndexEntry.from_line('?? file.txt') self.assertEqual(entry.status, '?') self.assertEqual(entry.file, 'file.txt')
def test_from_line_returns_correct_entry_for_ignored_file_our_format(self): entry = IndexEntry.from_line('! file.txt') self.assertEqual(entry.status, '!') self.assertEqual(entry.file, 'file.txt')
def test_from_line_returns_none_for_unknown_status(self): self.assertIsNone(IndexEntry.from_line('# file.txt'))
def test_from_line_returns_correct_entry_for_modified_file_git_format(self): entry = IndexEntry.from_line(' M file.txt') self.assertEqual(entry.status, 'M') self.assertEqual(entry.file, 'file.txt')
def test_from_line_returns_none_for_empty_line(self): self.assertIsNone(IndexEntry.from_line(''))
def test_from_line_returns_correct_entry_for_untracked_file_git_format(self): entry = IndexEntry.from_line('?? file.txt') self.assertEqual(entry.status, '?') self.assertEqual(entry.file, 'file.txt')
def test_from_line_returns_correct_entry_for_modified_file_git_format(self): entry = IndexEntry.from_line(' M file.txt') self.assertEqual(entry.status, 'M') self.assertEqual(entry.file, 'file.txt')
def test_from_line_returns_none_for_unknown_status(self): self.assertIsNone(IndexEntry.from_line('# file.txt'))
def test_from_line_returns_none_for_empty_line(self): self.assertIsNone(IndexEntry.from_line(''))