def test_file_a_takes_priority(self, test_dicts):
        # override some values for this test
        test_dicts.a['name'] = 'matching_name_file_a'
        test_dicts.b['name'] = 'matching_name_file_b'

        merged, _ = matching.merge_dedupe(test_dicts.a, test_dicts.b)
        assert merged['name'] == 'matching_name_file_a'
 def test_sources_are_combined(self, test_dicts):
     merged, _ = matching.merge_dedupe(test_dicts.a, test_dicts.b)
     assert merged['source'] == ['file_a', 'file_b']
 def test_empty_fields_are_merged(self, test_dicts):
     merged, _ = matching.merge_dedupe(test_dicts.a, test_dicts.b)
     assert merged['level'] == 3
     assert merged['length'] == '12 months'
 def test_missing_fields_are_merged(self, test_dicts):
     merged, _ = matching.merge_dedupe(test_dicts.a, test_dicts.b)
     assert merged.get('b_only_field') == 'b_data'
 def test_count(self, test_dicts):
     _, count = matching.merge_dedupe(test_dicts.a, test_dicts.b)
     assert count == 2  # the two fields containing None