def test_add(self): """ Add type. """ diff = Mock() diff.new_file = True self.assertEqual(DiffType.A, DiffType.for_diff(diff))
def test_deleted(self): """ Deleted type. """ diff = Mock() diff.new_file = False diff.deleted_file = True self.assertEqual(DiffType.D, DiffType.for_diff(diff))
def test_renamed(self): """ Renamed type. """ diff = Mock() diff.new_file = False diff.deleted_file = False diff.renamed = True self.assertEqual(DiffType.R, DiffType.for_diff(diff))
def test_unknown(self): """ Unknown type. """ diff = Mock() diff.new_file = False diff.deleted_file = False diff.renamed = False diff.a_blob = False diff.b_blob = False self.assertEqual(DiffType.U, DiffType.for_diff(diff))
def test_modified(self): """ Modified type. """ diff = Mock() diff.new_file = False diff.deleted_file = False diff.renamed = False diff.a_blob = 'blob a' diff.b_blob = 'blob b' self.assertEqual(DiffType.M, DiffType.for_diff(diff))