spinnaker_testbase package

Submodules

spinnaker_testbase.root_test_case module

class spinnaker_testbase.root_test_case.RootTestCase(methodName='runTest')[source]

Bases: TestCase

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.

static assert_not_spin_three()[source]

Will raise a SkipTest if run on a none virtual 4 chip board

Raises:

SkipTest – If we’re on the wrong sort of board

error_file()[source]

The file any error where reported to before a second run attempt

Returns:

Path to (possibly non existent) error file

report(message, file_name)[source]
runsafe(method, retry_delay=3.0, skip_exceptions=None)[source]

Will run the method possibly a few times

Parameters:
  • method (callable) –

  • retry_delay (float) –

  • skip_exceptions (list(class)) – list of exception classes to convert in SkipTest

spinnaker_testbase.test_no_job_destroy module

class spinnaker_testbase.test_no_job_destroy.TestNoJobDestory(methodName='runTest')[source]

Bases: BaseTestCase

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.

test_no_destory_file()[source]

Module contents

class spinnaker_testbase.BaseTestCase(methodName='runTest')[source]

Bases: RootTestCase

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.

assert_logs_messages(log_records, sub_message, log_level='ERROR', count=1, allow_more=False)[source]

Tool to assert the log messages contain the sub-message.

Parameters:
  • log_records – list of log message

  • sub_message – text to look for

  • log_level – level to look for

  • count – number of times this message should be found

  • allow_more – If True, OK to have more than count repeats

get_app_iobuf_files()[source]
get_provenance_files()[source]
get_system_iobuf_files()[source]
setUp()[source]

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

class spinnaker_testbase.RootScriptBuilder[source]

Bases: object

add_script(test_file, name, local_path, skip_imports)[source]
Parameters:
add_scripts(a_dir, prefix_len, test_file, too_long, exceptions, skip_exceptions)[source]
Parameters:
create_test_scripts(dirs, too_long=None, exceptions=None, skip_exceptions=None)[source]
Parameters:
  • dirs (str or list(str)) – List of dirs to find scripts in. These are relative paths to the repository

  • too_long (dict(str, str) or None) – Dict of files that take too long to run and how long. These are just the file name including the .py. They are mapped to a skip reason. These are only skip tests if asked to be (currently not done).

  • exceptions (dict(str, str) or None) – Dict of files that should be skipped. These are just the file name including the .py. They are mapped to a skip reason. These are always skipped.

  • skip_exceptions (dict(str,list(str))) –

    Dict of files and exceptions to skip on. These are just the file name including the .py. They are mapped to a list of INDIVIUAL import statements in the:

    from xyz import Abc
    

    format.

class spinnaker_testbase.ScriptChecker(methodName='runTest')[source]

Bases: RootTestCase

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.

check_script(script, broken_msg=None, skip_exceptions=None)[source]
Parameters:
  • script (str) – relative path to the file to run

  • broken_msg (str) – message to print instead of raising an exception; no current use-case known

  • skip_exceptions (list(type) or None) – list of exception classes to convert in SkipTest

script_path(script)[source]