tests.sparql_tests module#

Test cases for the SPARQL API.

class tests.sparql_tests.BnodeTests(*args, **kwargs)[source]#

Bases: SparqlNodeTests

Tests for sparql.Bnode.

abstract_class = False#
object_under_test = _:Foo#
class tests.sparql_tests.Container(value)[source]#

Bases: object

Simple test container for return values.

Create container.

json()[source]#

Simulate Response.json().

class tests.sparql_tests.LiteralTests(*args, **kwargs)[source]#

Bases: SparqlNodeTests

Tests for sparql.Literal.

abstract_class = False#
object_under_test = value#
class tests.sparql_tests.Shared[source]#

Bases: object

Shared test placeholder.

class SparqlNodeTests(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Tests encoding issues.

abstract_class = False#
object_under_test = None#
test__repr__returnsStringType()[source]#

__repr__ should return type str.

test__str__returnsStringType()[source]#

__str__ should return type str.

test_is_sparql_node()[source]#

Object should be a SparqlNode.

class tests.sparql_tests.TestSparql(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test SPARQL queries.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
testGetItems(mock_method)[source]#

Test item list retrieval via SPARQL.

testQueryAsk(mock_method)[source]#

Test ASK query.

testQuerySelect(mock_method)[source]#

Test SELECT query.

testQuerySelectFull(mock_method)[source]#

Test SELECT query with full data.

wikibase = True#
class tests.sparql_tests.URITests(*args, **kwargs)[source]#

Bases: SparqlNodeTests

Tests for sparql.URI.

abstract_class = False#
object_under_test = <http://foo.com>#