Skip to content

Commit

Permalink
test: ConjunctiveGraph operator return type (#2557)
Browse files Browse the repository at this point in the history
This change adds tests for the return type of the `+`, `-`, `*`, and `^`
operators on `ConjunctiveGraph` objects.

- Closes <#652>
  • Loading branch information
mielvds authored Aug 30, 2023
1 parent a8f20ae commit e42b752
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,12 @@ def test_operators_with_two_conjunctivegraphs_one_with_contexts():
assert len(cg1 * cg2) == 1 # only pizza

assert len(cg1 ^ cg2) == 9 # removes pizza


def test_operators_returning_correct_type():
g1 = ConjunctiveGraph()
g2 = ConjunctiveGraph()
assert type(g1 + g2) is ConjunctiveGraph
assert type(g1 - g2) is ConjunctiveGraph
assert type(g1 * g2) is ConjunctiveGraph
assert type(g1 ^ g2) is ConjunctiveGraph

0 comments on commit e42b752

Please sign in to comment.