def test_head_files(self): df = HeadFiles()(self.engine.repositories) df_as_dict = df.first().asDict() keys = set(df_as_dict.keys()) self.assertIn("commit_hash", keys) self.assertIn("path", keys) self.assertIn("content", keys) self.assertIn("reference_name", keys)
def test_uast_deserializer(self): df = HeadFiles()(self.engine.repositories) df_uast = UastExtractor()(df) r2d = UastRow2Document() row_uast = r2d.documentize(df_uast.first()) uasts_empty = list(UastDeserializer().deserialize_uast(df.first())) uasts = list(UastDeserializer().deserialize_uast(row_uast)) self.assertTrue(len(uasts_empty) == 0) self.assertTrue(len(uasts) > 0)