示例#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))