Пример #1
0
    def test_modified_file_then_return_M(self):
        self.diff_inst.b_blob.path = "old_file"

        diffs = dls_logs_since_release.get_file_changes(
            self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['M     old_file\n'])
    def test_new_file_then_return_A(self):
        self.diff_inst.new_file = True
        self.diff_inst.b_blob.path = "new_file"

        diffs = dls_logs_since_release.get_file_changes(self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['A     new_file\n'])
    def test_no_diff_then_return_empty_list(self):
        self.diff_inst.a_blob = False
        self.diff_inst.b_blob = False

        diff = dls_logs_since_release.get_file_changes(self.commit_inst_1, self.commit_inst_2)

        self.assertFalse(diff)
Пример #4
0
    def test_new_file_then_return_A(self):
        self.diff_inst.new_file = True
        self.diff_inst.b_blob.path = "new_file"

        diffs = dls_logs_since_release.get_file_changes(
            self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['A     new_file\n'])
Пример #5
0
    def test_no_diff_then_return_empty_list(self):
        self.diff_inst.a_blob = False
        self.diff_inst.b_blob = False

        diff = dls_logs_since_release.get_file_changes(self.commit_inst_1,
                                                       self.commit_inst_2)

        self.assertFalse(diff)
    def test_deleted_file_then_return_D(self):
        self.diff_inst.a_blob.path = "old_file"
        self.diff_inst.b_blob = False
        self.diff_inst.deleted_file = True

        diffs = dls_logs_since_release.get_file_changes(self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['D     old_file\n'])
Пример #7
0
    def test_deleted_file_then_return_D(self):
        self.diff_inst.a_blob.path = "old_file"
        self.diff_inst.b_blob = False
        self.diff_inst.deleted_file = True

        diffs = dls_logs_since_release.get_file_changes(
            self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['D     old_file\n'])
    def test_renamed_file_then_return_renamed(self):
        self.diff_inst.a_blob.path = "old_file"
        self.diff_inst.b_blob.path = "new_file"
        self.diff_inst.deleted_file = True
        self.diff_inst.new_file = True
        self.diff_inst.renamed = True

        diffs = dls_logs_since_release.get_file_changes(self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['A     new_file (Renamed)\n', 'D     old_file (Renamed)\n'])
Пример #9
0
    def test_renamed_file_then_return_renamed(self):
        self.diff_inst.a_blob.path = "old_file"
        self.diff_inst.b_blob.path = "new_file"
        self.diff_inst.deleted_file = True
        self.diff_inst.new_file = True
        self.diff_inst.renamed = True

        diffs = dls_logs_since_release.get_file_changes(
            self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(
            diffs,
            ['A     new_file (Renamed)\n', 'D     old_file (Renamed)\n'])
    def test_modified_file_then_return_M(self):
        self.diff_inst.b_blob.path = "old_file"

        diffs = dls_logs_since_release.get_file_changes(self.commit_inst_1, self.commit_inst_2)

        self.assertEqual(diffs, ['M     old_file\n'])