-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove testing and debug code from rdflib
This patch removes code from `rdflib/` that does not seem like it belongs in `rdflib/`, most of it is related to doctest, some of it belongs in `test/` and was moved to `test/test_misc/test_collection.py`, and yet more of it seems to just be there for debugging purposes, though it would possibly be better to put that in a separate place if it is needed again or to debug using tests if possible. Other changes: - Removed an invocation of `rdflib.util.test` from `test_util.py`. This seems like an attempt to invoke doctest however pytest takes care of that so this is not needed.
- Loading branch information
Showing
14 changed files
with
42 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import logging | ||
|
||
import pytest | ||
|
||
from rdflib import BNode, Graph, Literal | ||
from rdflib.collection import Collection | ||
|
||
|
||
def test_scenario() -> None: | ||
# Taken from https://github.com/RDFLib/rdflib/blob/8a92d3565bf2e502a7c4cadb34b29db72c89d623/rdflib/collection.py#L272-L304 | ||
g = Graph() | ||
|
||
c = Collection(g, BNode()) | ||
|
||
assert len(c) == 0 | ||
|
||
c = Collection(g, BNode(), [Literal("1"), Literal("2"), Literal("3"), Literal("4")]) | ||
|
||
assert len(c) == 4 | ||
|
||
assert c[1] == Literal("2"), c[1] | ||
|
||
del c[1] | ||
|
||
assert list(c) == [Literal("1"), Literal("3"), Literal("4")], list(c) | ||
|
||
with pytest.raises(IndexError): | ||
del c[500] | ||
|
||
c.append(Literal("5")) | ||
|
||
logging.debug("list(c) = %s", list(c)) | ||
|
||
for i in c: | ||
logging.debug("i = %s", i) | ||
|
||
del c[3] | ||
|
||
c.clear() | ||
|
||
assert len(c) == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters