Skip to content

Commit

Permalink
test: update tests to ensure deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondchuc committed Mar 13, 2024
1 parent ba43c01 commit 9c9faa0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/test_graph/test_container.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from rdflib import Graph
from rdflib.container import Alt, Bag, Seq
from rdflib.term import BNode, Literal
Expand Down Expand Up @@ -81,6 +83,10 @@ def test_q(self):
assert self.c2.index(Literal("1000")) != 3

def test_r(self):
assert self.c1.type_of_container() == self.c1.type_of_conatiner()
assert self.c3.type_of_container() == self.c3.type_of_conatiner()
assert self.c4.type_of_container() == self.c4.type_of_conatiner()
match = "rdflib.container.Container.type_of_conatiner is deprecated. Use type_of_container method instead."
with pytest.warns(DeprecationWarning, match=match):
assert self.c1.type_of_container() == self.c1.type_of_conatiner()
with pytest.warns(DeprecationWarning, match=match):
assert self.c3.type_of_container() == self.c3.type_of_conatiner()
with pytest.warns(DeprecationWarning, match=match):
assert self.c4.type_of_container() == self.c4.type_of_conatiner()

0 comments on commit 9c9faa0

Please sign in to comment.