TestIsNamedTuple

class tests.test_collections.TestIsNamedTuple(methodName='runTest')[source]

Test the function is_namedtuple() against various different types and objects to ensure it returns True or False appropriately, with tests containing a mixture of both collections.namedtuple() and dictable_namedtuple().

__init__(methodName='runTest')

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods

Methods

test_dictable_namedtuple()

Test is_namedtuple() returns True when all arguments are valid dictable_namedtuple’s

test_dictable_namedtuple_plus_invalid()

(dictable_namedtuples) Test is_namedtuple() returns False when some arguments are NOT namedtuple’s

test_dictable_plus_normal_namedtuple()

Test is_namedtuple() returns True when arguments are a mix of namedtuple + dictable_namedtuple’s

test_not_namedtuple_class()

Test that classes and instances of classes are not namedtuple’s

test_not_namedtuple_dict()

Test that dictionaries are not namedtuple’s

test_not_namedtuple_float()

Test that float’s are not namedtuple’s

test_not_namedtuple_int()

Test that int’s are not namedtuple’s

test_not_namedtuple_list()

Test that list’s are not namedtuple’s

test_not_namedtuple_tuple()

Test that tuple’s are not namedtuple’s

test_real_namedtuple()

Test is_namedtuple() returns True when all arguments are valid namedtuple’s

test_real_namedtuple_plus_invalid()

(namedtuples) Test is_namedtuple() returns False when some arguments are NOT namedtuple’s

Attributes

Attributes

dict_persons

named_persons