def test_check_table_order_invalid_df2(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     status = afg.check_table_order(A, None, l_attr_types, r_attr_types, attr_corres)
 def test_check_table_order_valid(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     status = afg.check_table_order(A, B, l_attr_types, r_attr_types, attr_corres)
     self.assertEqual(status, True)
 def test_check_table_order_invalid_df2(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     status = afg.check_table_order(A, None, l_attr_types, r_attr_types,
                                    attr_corres)
 def test_get_features_invalid_ltable_rtable_switch(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(B, A)
     tok = get_tokenizers_for_matching()
     sim = get_sim_funs_for_matching()
     feat_table = afg.get_features(A, B, l_attr_types, r_attr_types, attr_corres, tok, sim)
 def test_check_table_order_invalid_attrcorres_ltable(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     attr_corres['ltable'] = pd.DataFrame()
     status = afg.check_table_order(A, B, l_attr_types, r_attr_types, attr_corres)
     self.assertEqual(status, False)
 def test_check_table_order_valid(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     status = afg.check_table_order(A, B, l_attr_types, r_attr_types,
                                    attr_corres)
     self.assertEqual(status, True)
 def test_get_features_invalid_ltable_rtable_switch(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(B, A)
     tok = get_tokenizers_for_matching()
     sim = get_sim_funs_for_matching()
     feat_table = afg.get_features(A, B, l_attr_types, r_attr_types,
                                   attr_corres, tok, sim)
 def test_check_table_order_invalid_attrcorres_ltable(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     attr_corres['ltable'] = pd.DataFrame()
     status = afg.check_table_order(A, B, l_attr_types, r_attr_types,
                                    attr_corres)
     self.assertEqual(status, False)
 def test_get_features_valid(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     tok = get_tokenizers_for_matching()
     sim = get_sim_funs_for_matching()
     feat_table = afg.get_features(A, B, l_attr_types, r_attr_types, attr_corres, tok, sim)
     self.assertEqual(isinstance(feat_table, pd.DataFrame), True)
     functions = feat_table['function']
     for f in functions:
         x = f(A.ix[1], B.ix[2])
         self.assertEqual(x >= 0, True)
 def test_get_features_valid(self):
     A = read_csv_metadata(path_a)
     B = read_csv_metadata(path_b, key='ID')
     l_attr_types = afg.get_attr_types(A)
     r_attr_types = afg.get_attr_types(B)
     attr_corres = afg.get_attr_corres(A, B)
     tok = get_tokenizers_for_matching()
     sim = get_sim_funs_for_matching()
     feat_table = afg.get_features(A, B, l_attr_types, r_attr_types,
                                   attr_corres, tok, sim)
     self.assertEqual(isinstance(feat_table, pd.DataFrame), True)
     functions = feat_table['function']
     for f in functions:
         x = f(A.ix[1], B.ix[2])
         self.assertEqual(x >= 0, True)