single pred invert filter
@@ -11,6 +11,7 @@ class TestKGTKFilter(unittest.TestCase):
self.file_path2 = 'data/sample_kgtk_non_edge_file.tsv'
self.temp_dir = tempfile.mkdtemp()
self.df = pd.read_csv(self.file_path, sep='\t')
+ self.df2 = pd.read_csv(self.file_path2, sep='\t')
def tearDown(self) -> None:
shutil.rmtree(self.temp_dir)
@@ -50,9 +51,10 @@ class TestKGTKFilter(unittest.TestCase):
self.assertEqual(len(df), 1)
def test_kgtk_filter_spo(self):
+ df = self.df2.loc[self.df2['sub'] != 'Q65695069']
cli_entry("kgtk", "filter", "-i", self.file_path2, "-o", f'{self.temp_dir}/Q65695069.tsv', "-p",
"Q65695069;;", "--subj", "sub", "--pred", "pred", "--obj", "obj", "-v", "--invert")
- df = pd.read_csv(f'{self.temp_dir}/Q65695069.tsv', sep='\t')
+ df_r = pd.read_csv(f'{self.temp_dir}/Q65695069.tsv', sep='\t')
- self.assertEqual(len(df), 266)
+ self.assertEqual(len(df_r), len(df))
