tests.tools_tests module#
Test tools package alone which don’t fit into other tests.
- class tests.tools_tests.AddStopList[source]#
Bases:
set
Container that stops when encountering items.
- stop_list = []#
- class tests.tools_tests.BasicGeneratorIntersectTestCase(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,GeneratorIntersectTestCase
Disconnected intersect_generators test cases.
- abstract_class = False#
- class tests.tools_tests.ContainsStopList[source]#
Bases:
set
Container that stops when encountering items.
- stop_list = []#
- class tests.tools_tests.DecoratedMethods[source]#
Bases:
object
Test class to verify cached decorator.
Initializer, reset read counter.
- property bar#
A property.
- class tests.tools_tests.Foo[source]#
Bases:
object
Test class to verify classproperty decorator.
- bar = 'baz'#
- class tests.tools_tests.GeneratorIntersectTestCase(*args, **kwargs)[source]#
Bases:
TestCase
Base class for intersect_generators test cases.
- abstract_class = True#
- class tests.tools_tests.MergeUniqueDicts(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test merge_unique_dicts.
- abstract_class = False#
- dct1 = {'42': 'answer', 'foo': 'bar'}#
- dct2 = {47: 'Star', 74: 'Trek'}#
- dct_both = {'42': 'answer', 'foo': 'bar', 47: 'Star', 74: 'Trek'}#
- class tests.tools_tests.OpenArchiveTestCase(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Unit test class for tools.
The tests for open_archive requires that article-pyrus.xml* contain all the same content after extraction. The content itself is not important. The file article-pyrus.xml_invalid.7z is not a valid 7z file and open_archive will fail extracting it using 7za.
- abstract_class = False#
- class tests.tools_tests.OpenArchiveWriteTestCase(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test writing with open_archive.
- abstract_class = False#
- class tests.tools_tests.ProcessAgainList[source]#
Bases:
set
Container that keeps processing certain items.
- process_again_list = [1, 3]#
- class tests.tools_tests.SkipList[source]#
Bases:
set
Container that ignores items.
- skip_list = [1, 3]#
- class tests.tools_tests.TestClassProperty(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test classproperty decorator.
- abstract_class = False#
- class tests.tools_tests.TestFileModeChecker(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test parsing password files.
- abstract_class = False#
- class tests.tools_tests.TestFileShaCalculator(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test calculator of sha of a file.
There are two possible hash values for each test. The second one is for files with Windows line endings (rn).
- abstract_class = False#
- filename = '/src/tests/data/xml/article-pear-0.10.xml'#
- md5_tests = {'function': functools.partial(<function hash_func>, 'md5'), 'hash': <built-in function openssl_md5>, 'str': 'md5'}#
- class tests.tools_tests.TestFilterUnique(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test filter_unique.
- abstract_class = False#
- decs = [Decimal('1'), Decimal('3'), Decimal('2'), Decimal('1'), Decimal('2'), Decimal('1'), Decimal('2'), Decimal('4'), Decimal('2')]#
- ints = [1, 3, 2, 1, 2, 1, 2, 4, 2]#
- strs = ['1', '3', '2', '1', '2', '1', '2', '4', '2']#
- class tests.tools_tests.TestHasModule(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Unit test class for has_module.
- abstract_class = False#
- class tests.tools_tests.TestIsIpAddress(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Unit test class for is_ip_address.
- abstract_class = False#
- class tests.tools_tests.TestIsSliceWithEllipsis(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test islice_with_ellipsis.
- abstract_class = False#
- it = ['a', 'b', 'c', 'd', 'f']#
- it_null = []#
- test_do_not_show_marker_when_get_all()[source]#
Test marker is not shown when all elements are retrieved.
- test_do_not_show_marker_with_stop_zero()[source]#
Test marker is shown with stop for empty iterable.
- test_show_custom_marker_with_start_stop()[source]#
Test marker is shown with start and stop with kwargs.
- class tests.tools_tests.TestMergeGenerator(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test merging generators.
- abstract_class = False#
- class tests.tools_tests.TestStringFunctions(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Unit test class for string functions.
- abstract_class = False#
- class tests.tools_tests.TestTinyCache(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test cached decorator.
- abstract_class = False#