From 346dc2bef5719deb199270c2ae942228697fc360 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 29 Feb 2024 23:30:13 -0600 Subject: [PATCH] tests should pass and minor typo --- .../utilities/writers/change_handler.py | 12 ++++----- tests/test_cli.py | 15 +++-------- tests/test_implementations/__init__.py | 25 ++----------------- 3 files changed, 12 insertions(+), 40 deletions(-) diff --git a/src/oaklib/utilities/writers/change_handler.py b/src/oaklib/utilities/writers/change_handler.py index 8a091b414..a6d67550e 100644 --- a/src/oaklib/utilities/writers/change_handler.py +++ b/src/oaklib/utilities/writers/change_handler.py @@ -55,7 +55,7 @@ def handle_edge_deletion(self, value): header = "| Subject| Predicate| Object|" # Write the "Edges Deleted" section as a collapsible markdown table - self.write_markdown_table(f"Edges deleted: {len(rows)}", header, rows) + self.write_markdown_table(f"Edges removed: {len(rows)}", header, rows) def handle_edge_creation(self, value): # Create rows for the table @@ -69,7 +69,7 @@ def handle_edge_creation(self, value): header = "| Subject | Predicate | Object|" # Write the "Edges Created" section as a collapsible markdown table - self.write_markdown_table(f"Mappings created: {len(rows)}", header, rows) + self.write_markdown_table(f"Mappings added: {len(rows)}", header, rows) def handle_edge_change(self, value): # Create rows for the table @@ -98,7 +98,7 @@ def handle_mapping_edge_deletion(self, value): header = "| Subject | Predicate | Object |" # Write the "Edges Deleted" section as a collapsible markdown table - self.write_markdown_table(f"Mappings deleted: {len(rows)}", header, rows) + self.write_markdown_table(f"Mappings removed: {len(rows)}", header, rows) def handle_node_move(self, value): # Create rows for the table @@ -216,7 +216,7 @@ def handle_node_creation(self, value): header = "| Term |" # Write the "Node Created" section as a markdown table - self.write_markdown_table(f"Other nodes created: {len(rows)}", header, rows) + self.write_markdown_table(f"Other nodes added: {len(rows)}", header, rows) def handle_class_creation(self, value): # Create rows for the table @@ -226,7 +226,7 @@ def handle_class_creation(self, value): header = "| Term |" # Write the "Class Created" section as a markdown table - self.write_markdown_table(f"Classes created: {len(rows)}", header, rows) + self.write_markdown_table(f"Classes added: {len(rows)}", header, rows) def handle_node_deletion(self, value): # Create rows for the table @@ -236,7 +236,7 @@ def handle_node_deletion(self, value): header = "| Term |" # Write the "Nodes Deleted" section as a markdown table - self.write_markdown_table(f"Nodes deleted: {len(rows)}", header, rows) + self.write_markdown_table(f"Nodes removed: {len(rows)}", header, rows) def handle_new_text_definition(self, value): # Create rows for the table diff --git a/tests/test_cli.py b/tests/test_cli.py index 27e726992..7c00af55c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1490,16 +1490,9 @@ def test_diff_md(self): # Check for Nodes Created section self.assertIn("
", contents) - self.assertIn("Other nodes created: 1", contents) - self.assertIn("| ID | Label |", contents) - self.assertIn("----|----", contents) - self.assertIn("| RO:0000053 | has characteristic |", contents) - self.assertIn("
", contents) + self.assertIn("Other nodes added: 1", contents) + self.assertIn("| has characteristic (RO:0000053) |", contents) # Check for Classes Created section - self.assertIn("
", contents) - self.assertIn("Classes created: 1", contents) - self.assertIn("| ID | Label |", contents) - self.assertIn("----|----", contents) - self.assertIn("| PATO:0001735 | liquid configuration |", contents) - self.assertIn("
", contents) + self.assertIn("Classes added: 1", contents) + self.assertIn("| liquid configuration (PATO:0001735) |", contents) diff --git a/tests/test_implementations/__init__.py b/tests/test_implementations/__init__.py index d84d4ca50..09566f8c9 100644 --- a/tests/test_implementations/__init__.py +++ b/tests/test_implementations/__init__.py @@ -960,27 +960,6 @@ def test_diff(self, oi: DifferInterface, oi_modified: DifferInterface): old_value="catalytic activity", ), kgcl.NodeDeletion(id=FIXED_ID, about_node="GO:0033673"), - kgcl.RemoveSynonym( - id=FIXED_ID, - about_node="GO:0033673", - old_value="inhibition of kinase activity", - ), - kgcl.RemoveSynonym(id=FIXED_ID, about_node="GO:0033673", old_value="kinase inhibitor"), - kgcl.RemoveSynonym( - id=FIXED_ID, - about_node="GO:0033673", - old_value="down regulation of kinase activity", - ), - kgcl.RemoveSynonym( - id=FIXED_ID, - about_node="GO:0033673", - old_value="downregulation of kinase activity", - ), - kgcl.RemoveSynonym( - id=FIXED_ID, - about_node="GO:0033673", - old_value="down-regulation of kinase activity", - ), kgcl.EdgeDeletion( id=FIXED_ID, subject="GO:0033673", @@ -1057,10 +1036,10 @@ def test_diff(self, oi: DifferInterface, oi_modified: DifferInterface): logging.info(summary) residual = summary["__RESIDUAL__"] cases = [ - ("RemoveSynonym", 6), + ("RemoveSynonym", 1), ("NewSynonym", 1), ("NodeDeletion", 1), - ("All_Synonym", 7), + ("All_Synonym", 2), ("NodeRename", 1), ("EdgeDeletion", 5), ]