taucmdr.cli.tests.test_arguments module

Test functions.

Functions used for unit tests of arguments.py.

class taucmdr.cli.tests.test_arguments.ArgumentsTest(methodName='runTest')[source]

Bases: TestCase

Tests for taucmdr.cli.arguments.

_classSetupFailed = False
_class_cleanups = []
test_group_order()[source]

Help lists positional arguments, then options, then the other groups alphabetically.

test_no_argparse_colors()[source]

Help text has no colors from argparse itself, even where argparse would add them.

class taucmdr.cli.tests.test_arguments.ParseBooleanActionTest(methodName='runTest')[source]

Bases: TestCase

Tests for the T/F argument action.

_classSetupFailed = False
_class_cleanups = []
_parse(value)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_other_values_rejected()[source]

Anything else is an argument error.

test_true_and_false_spellings()[source]

Common spellings of true and false parse to booleans.

class taucmdr.cli.tests.test_arguments.ParsePackagePathActionTest(methodName='runTest')[source]

Bases: TestCase

Tests for the –<package> argument action shared by every software package option.

_classSetupFailed = False
_class_cleanups = []
_parse(value)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_existing_archive_made_absolute()[source]

A relative path to an existing file (an archive) becomes absolute.

test_existing_directory_made_absolute()[source]

A relative path to an existing directory becomes absolute.

test_false_disables_package()[source]

Any false-ish value disables the package.

test_home_directory_expanded()[source]

A leading tilde is expanded before the path is checked.

test_keywords()[source]

‘download’ and ‘nightly’ are accepted in any case and normalized to lower case.

test_missing_path_rejected()[source]

A path that exists neither as a directory nor a readable file is rejected.

test_rejected_keywords()[source]

Values listed in rejected are refused with the given reason, regardless of case.

test_unlisted_keyword_is_a_path()[source]

Without a rejected entry an unknown keyword is just a path that does not exist.

test_url_kept_verbatim()[source]

URLs are not touched, so nothing is checked on the local filesystem.

taucmdr.cli.tests.test_arguments._help_text(description=None)[source]

Return the help text of a parser with a positional argument, an option and two more groups.