mach.test package

Submodules

mach.test.common module

class mach.test.common.TestBase(methodName='runTest')

Bases: unittest.case.TestCase

get_mach(provider_file=None, entry_point=None, context_handler=None)
provider_dir = u'/builds/worker/checkouts/gecko/python/mach/mach/test/providers'

mach.test.test_conditions module

class mach.test.test_conditions.TestConditions(methodName='runTest')

Bases: mach.test.common.TestBase

Tests for conditionally filtering commands.

test_conditions_pass()

Test that a command which passes its conditions is runnable.

test_help_message()

Test that commands that are not runnable do not show up in help.

test_invalid_context_message()

Test that commands which do not pass all their conditions print the proper failure message.

test_invalid_type()

Test that a condition which is not callable raises an exception.

mach.test.test_config module

class mach.test.test_config.Provider1

Bases: object

config_settings = [(u'foo.bar', <class 'mach.config.StringType'>, u'desc'), (u'foo.baz', <class 'mach.config.PathType'>, u'desc')]
class mach.test.test_config.Provider2

Bases: object

config_settings = [(u'a.string', <class 'mach.config.StringType'>, u'desc'), (u'a.boolean', <class 'mach.config.BooleanType'>, u'desc'), (u'a.pos_int', <class 'mach.config.PositiveIntegerType'>, u'desc'), (u'a.int', <class 'mach.config.IntegerType'>, u'desc'), (u'a.path', <class 'mach.config.PathType'>, u'desc')]
class mach.test.test_config.Provider3

Bases: object

classmethod config_settings()
class mach.test.test_config.Provider4

Bases: object

config_settings = [(u'foo.abc', <class 'mach.config.StringType'>, u'desc', u'a', {u'choices': set([u'a', u'c', u'b'])}), (u'foo.xyz', <class 'mach.config.StringType'>, u'desc', u'w', {u'choices': set([u'y', u'x', u'z'])})]
class mach.test.test_config.Provider5

Bases: object

config_settings = [(u'foo.*', u'string', u'desc'), (u'foo.bar', u'string', u'desc')]
class mach.test.test_config.ProviderDuplicate

Bases: object

config_settings = [(u'dupesect.foo', <class 'mach.config.StringType'>, u'desc'), (u'dupesect.foo', <class 'mach.config.StringType'>, u'desc')]
class mach.test.test_config.TestConfigSettings(methodName='runTest')

Bases: unittest.case.TestCase

retrieval_type_helper(provider)
test_assignment_validation()
test_choices_validation()
test_duplicate_option()
test_empty()
test_file_reading_missing()

Missing files should silently be ignored.

test_file_reading_multiple()

Loading multiple files has proper overwrite behavior.

test_file_reading_single()
test_file_writing()
test_retrieval_type()
test_simple()
test_wildcard_options()

mach.test.test_dispatcher module

class mach.test.test_dispatcher.TestDispatcher(methodName='runTest')

Bases: mach.test.common.TestBase

Tests dispatch related code

get_parser(config=None)
test_command_aliases()

mach.test.test_entry_point module

class mach.test.test_entry_point.Entry(providers)

Stub replacement for pkg_resources.EntryPoint

load()
class mach.test.test_entry_point.TestEntryPoints(methodName='runTest')

Bases: mach.test.common.TestBase

Test integrating with setuptools entry points

provider_dir = u'/builds/worker/checkouts/gecko/python/mach/mach/test/providers'
test_load_entry_point_from_directory(*args, **keywargs)
test_load_entry_point_from_file(*args, **keywargs)

mach.test.test_error_output module

class mach.test.test_error_output.TestErrorOutput(methodName='runTest')

Bases: mach.test.common.TestBase

test_command_error()
test_invoked_error()

mach.test.test_logger module

class mach.test.test_logger.DummyLogger(cb)

Bases: logging.Logger

handle(record)
class mach.test.test_logger.TestStructuredHumanFormatter(methodName='runTest')

Bases: unittest.case.TestCase

test_non_ascii_logging()

Module contents