Пример #1
0
    def test_add(self):
        """
        Add type.
        """
        diff = Mock()
        diff.new_file = True

        self.assertEqual(DiffType.A, DiffType.for_diff(diff))
Пример #2
0
    def test_add(self):
        """
        Add type.
        """
        diff = Mock()
        diff.new_file = True

        self.assertEqual(DiffType.A, DiffType.for_diff(diff))
Пример #3
0
    def test_deleted(self):
        """
        Deleted type.
        """
        diff = Mock()
        diff.new_file = False
        diff.deleted_file = True

        self.assertEqual(DiffType.D, DiffType.for_diff(diff))
Пример #4
0
    def test_deleted(self):
        """
        Deleted type.
        """
        diff = Mock()
        diff.new_file = False
        diff.deleted_file = True

        self.assertEqual(DiffType.D, DiffType.for_diff(diff))
Пример #5
0
    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))
Пример #6
0
    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))
Пример #7
0
    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))
Пример #8
0
    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))
Пример #9
0
    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))
Пример #10
0
    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))