def test_old_results_have_shifted_subset(self):
        secretA = self.get_secret()
        secretA['is_secret'] = False

        secretB = self.get_secret()
        secretC = self.get_secret()
        secretD = self.get_secret()

        modified_secretB = secretB.copy()
        modified_secretB['is_secret'] = True
        modified_secretC = secretC.copy()
        modified_secretC['is_secret'] = False

        assert merge_results(
            {
                'filename': [
                    secretA,
                    secretB,
                    secretC,
                    secretD,
                ],
            },
            {
                'filename': [
                    modified_secretB,
                    modified_secretC,
                ],
            },
        ) == {
            'filename': [
                modified_secretB,
                modified_secretC,
            ],
        }
    def test_new_results_has_nothing(self):
        old_result = {
            'filenameA': [
                self.get_secret(),
            ],
        }

        assert merge_results(old_result, {}) == {}
    def test_old_results_completely_overriden(self):
        secretA = self.get_secret()
        secretB = self.get_secret()

        assert merge_results(
            {
                'filenameA': [secretA],
            },
            {
                'filenameA': [secretB],
            },
        ) == {
            'filenameA': [secretB],
        }
    def test_old_results_have_diff_type_will_carry_over(self):
        secretA = self.get_secret()
        secretA['type'] = 'different type'
        secretB = self.get_secret()

        assert merge_results(
            {
                'filenameA': [
                    secretA,
                ],
            },
            {
                'filenameA': [
                    secretA,
                    secretB,
                ],
            },
        ) == {
            'filenameA': [
                secretA,
                secretB,
            ],
        }
    def test_old_results_have_subset_of_new_results(self):
        secretA = self.get_secret()
        secretB = self.get_secret()

        modified_secretA = secretA.copy()
        modified_secretA['is_secret'] = True

        assert merge_results(
            {
                'filenameA': [
                    secretA,
                    secretB,
                ],
            },
            {
                'filenameA': [
                    modified_secretA,
                ],
            },
        ) == {
            'filenameA': [
                modified_secretA,
            ],
        }