try to move tests outside
@@ -69,6 +69,10 @@ class DataPackTest(unittest.TestCase):
self.assertEqual(len(instances), 1)
self.assertEqual(instances[0]["offset"], 0)
+ # case 3.1: test get single
+ document: Document = self.data_pack.get_single(Document)
+ self.assertEqual(document.text, instances[0]['context'])
+
# case 4: test offset out of index
instances = list(self.data_pack.get_data(Sentence, skip_k=10))
self.assertEqual(len(instances), 0)
@@ -87,7 +91,8 @@ class DataPackTest(unittest.TestCase):
num_sent = len(sentences)
first_sent = sentences[0]
self.data_pack.delete_entry(first_sent)
- self.assertEqual(len(list(self.data_pack.get_data(Sentence))), num_sent - 1)
+ self.assertEqual(len(list(self.data_pack.get_data(Sentence))),
+ num_sent - 1)
if __name__ == '__main__':
