tests.namespace_tests module#

Tests for the Namespace class.

class tests.namespace_tests.TestNamespaceCollections(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Test how Namespace interact when in collections.

abstract_class = False#
test_set()[source]#

Test converting sequence of Namespace to a set.

test_set_minus()[source]#

Test performing set minus operation on set of Namespace objects.

class tests.namespace_tests.TestNamespaceObject(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Test cases for Namespace class.

abstract_class = False#
testNamespaceCompare()[source]#

Test Namespace comparisons.

testNamespaceConstructor()[source]#

Test Namespace constructor.

testNamespaceNameCase()[source]#

Namespace names are always case-insensitive.

testNamespaceNormalizeName()[source]#

Test Namespace.normalize_name.

testNamespaceToString()[source]#

Test Namespace __str__.

testNamespaceTypes()[source]#

Test cases for methods manipulating Namespace names.

test_enums()[source]#

Test builtin namespace enum in Namespace.

test_repr()[source]#

Test Namespace.__repr__.

class tests.namespace_tests.TestNamespacesDictGetItem(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Test NamespacesDict.__getitem__.

EMPTYTEXT_RE = '\\s*'#
VALIDNUMBER_RE = '-?(0|[1-9]\\d*)'#
abstract_class = False#
test_all()[source]#

Test lookup by any namespace name.

test_canonical_attr()[source]#

Test attribute lookup by canonical namespace name.

test_canonical_name()[source]#

Test lookup by canonical namespace name.

test_ids()[source]#

Test lookup by canonical namespace id.

test_invalid_id()[source]#

Test lookup by invalid id.

test_invalid_name()[source]#

Test lookup by invalid name.

test_namespace()[source]#

Test lookup by Namespace object.

class tests.namespace_tests.TestNamespacesDictLookupName(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Test NamespacesDict.lookup_name and lookup_normalized_name.

abstract_class = False#
setUp()[source]#

Setup namespaces dict.

test_getattr()[source]#

Test NamespacesDict.__getattr__.

test_lookup_name()[source]#

Test lookup_name and getitem.

test_lookup_normalized_name()[source]#

Test lookup_normalized_name.

tests = {4: ['project', 'PROJECT', 'Project', 'Project:'], 5: ['project talk', 'PROJECT TALK', 'Project talk', 'Project Talk:', 'project_talk', 'PROJECT_TALK', 'Project_talk', 'Project_Talk:']}#
tests.namespace_tests.builtin_NamespacesDict()[source]#

Return a NamespacesDict of the builtin namespaces.