Ejemplo n.º 1
0
    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'
Ejemplo n.º 2
0
 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']
Ejemplo n.º 3
0
 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'
Ejemplo n.º 4
0
 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'
Ejemplo n.º 5
0
 def test_count(self, test_dicts):
     _, count = matching.merge_dedupe(test_dicts.a, test_dicts.b)
     assert count == 2  # the two fields containing None