def test_bl_combiner_wi_no_tuples(): A = mg.read_csv(path_for_A, key='ID') B = mg.read_csv(path_for_B, key='ID') ab = mg.AttrEquivalenceBlocker() C1 = ab.block_tables(A, B, 'name', 'name') C = mg.combine_block_outputs_via_union([C1, C1, C1]) s = ['_id', 'ltable.ID', 'rtable.ID'] assert_equal(sorted(s) == sorted(C.columns), True) assert_equal(C.get_key(), '_id') assert_equal(C.get_property('foreign_key_ltable'), 'ltable.ID') assert_equal(C.get_property('foreign_key_rtable'), 'rtable.ID')
def test_bl_combiner_wi_no_fields(): A = mg.read_csv(path_for_A, key='ID') B = mg.read_csv(path_for_B, key='ID') ab = mg.AttrEquivalenceBlocker() C1 = ab.block_tables(A, B, 'zipcode', 'zipcode') C2 = ab.block_tables(A, B, 'hourly_wage', 'hourly_wage') C3 = ab.block_tables(A, B, 'birth_year', 'birth_year') C = mg.combine_block_outputs_via_union([C1, C2, C3]) s = ['_id', 'ltable.ID', 'rtable.ID'] assert_equal(sorted(s) == sorted(C.columns), True) assert_equal(C.get_key(), '_id') assert_equal(C.get_property('foreign_key_ltable'), 'ltable.ID') assert_equal(C.get_property('foreign_key_rtable'), 'rtable.ID')