Skip to content

Commit

Permalink
fix: #2689
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondchuc committed Mar 13, 2024
1 parent 9834665 commit ba43c01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rdflib/container.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from random import randint

from rdflib.namespace import RDF
Expand Down Expand Up @@ -82,6 +83,15 @@ def __len__(self):
return self._len

def type_of_conatiner(self):
warnings.warn(
"rdflib.container.Container.type_of_conatiner is deprecated. "
"Use type_of_container method instead.",
DeprecationWarning,
stacklevel=2,
)
return self._rtype

def type_of_container(self):
return self._rtype

def index(self, item):
Expand Down
5 changes: 5 additions & 0 deletions test/test_graph/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ def test_p(self):

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()

0 comments on commit ba43c01

Please sign in to comment.