Skip to content

Commit

Permalink
tests should pass and minor typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Mar 1, 2024
1 parent 7578db2 commit 346dc2b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 40 deletions.
12 changes: 6 additions & 6 deletions src/oaklib/utilities/writers/change_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
15 changes: 4 additions & 11 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,16 +1490,9 @@ def test_diff_md(self):

# Check for Nodes Created section
self.assertIn("<details>", contents)
self.assertIn("<summary>Other nodes created: 1</summary>", contents)
self.assertIn("| ID | Label |", contents)
self.assertIn("----|----", contents)
self.assertIn("| RO:0000053 | has characteristic |", contents)
self.assertIn("</details>", contents)
self.assertIn("<summary>Other nodes added: 1</summary>", contents)
self.assertIn("| has characteristic (RO:0000053) |", contents)

# Check for Classes Created section
self.assertIn("<details>", contents)
self.assertIn("<summary>Classes created: 1</summary>", contents)
self.assertIn("| ID | Label |", contents)
self.assertIn("----|----", contents)
self.assertIn("| PATO:0001735 | liquid configuration |", contents)
self.assertIn("</details>", contents)
self.assertIn("<summary>Classes added: 1</summary>", contents)
self.assertIn("| liquid configuration (PATO:0001735) |", contents)
25 changes: 2 additions & 23 deletions tests/test_implementations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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),
]
Expand Down

0 comments on commit 346dc2b

Please sign in to comment.