Reenable the small value test.
@@ -123,27 +123,27 @@ class TestTripleGeneration(unittest.TestCase):
# in the numeric value, but the change in string representation causes
# the test, as written, to sometimes fail.
#
- # def test_triple_small_values(self):
- # small_values_file = Path('data/small_values.tsv')
- # wikidata_property_file = 'data/wikidata_properties.tsv'
- # o = 'data/small_values_tmp.ttl'
- # generator = TripleGenerator(prop_file=wikidata_property_file, label_set='label', alias_set='aliases',
- # description_set='descriptions', warning=True, n=100, truthy=True, use_id=True,
- # dest_fp=o, log_path="data/warning.log", prop_declaration=False, prefix_path="NONE",
- # input_file=small_values_file, error_action='log')
- # generator.process()
- #
- # with open('data/small_values.ttl') as f1:
- # f1_lines = f1.readlines()
- # with open('data/small_values_tmp.ttl') as f2:
- # f2_lines = f2.readlines()
- # self.assertEqual(f1_lines, f2_lines)
- #
- # self.assertEqual(os.stat("data/warning.log").st_size, 0)
- # p = Path("data/warning.log")
- # p.unlink()
- # p = Path('data/small_values_tmp.ttl')
- # p.unlink()
+ def test_triple_small_values(self):
+ small_values_file = Path('data/small_values.tsv')
+ wikidata_property_file = 'data/wikidata_properties.tsv'
+ o = 'data/small_values_tmp.ttl'
+ generator = TripleGenerator(prop_file=wikidata_property_file, label_set='label', alias_set='aliases',
+ description_set='descriptions', warning=True, n=100, truthy=True, use_id=True,
+ dest_fp=o, log_path="data/warning.log", prop_declaration=False, prefix_path="NONE",
+ input_file=small_values_file, error_action='log')
+ generator.process()
+
+ with open('data/small_values.ttl') as f1:
+ f1_lines = f1.readlines()
+ with open('data/small_values_tmp.ttl') as f2:
+ f2_lines = f2.readlines()
+ self.assertEqual(f1_lines, f2_lines)
+
+ self.assertEqual(os.stat("data/warning.log").st_size, 0)
+ p = Path("data/warning.log")
+ p.unlink()
+ p = Path('data/small_values_tmp.ttl')
+ p.unlink()
def test_triple_corrupted_edges(self):
corrupted_kgtk_file = Path('data/corrupted_kgtk.tsv')
