fireworks.tests package — FireWorks 2.0.2 documentation

# fireworks.tests package

## Submodules

## fireworks.tests.master_tests module

class `fireworks.tests.master_tests.` `BasicTests`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  Make sure that required external libraries can be imported

  `test_fwconnector`()
  `test_parentconnector`()

class `fireworks.tests.master_tests.` `SerializationTests`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  static `get_data`(obj_dict)
  `test_recursive_deserialize`()
  `test_serialization_details`()

class `fireworks.tests.master_tests.` `TestImports`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  Make sure that required external libraries can be imported

  `test_imports`()

## fireworks.tests.mongo_tests module

class `fireworks.tests.mongo_tests.` `ModSpecTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  `run_task`(fw_spec)

    This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

    Parameters

      fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

    Returns

      (FWAction)

class `fireworks.tests.mongo_tests.` `MongoTests`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

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

  classmethod `setUpClass`()

    Hook method for setting up class fixture before running tests in the class.

  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  classmethod `tearDownClass`()

    Hook method for deconstructing the class fixture after running all tests in the class.

  `test_add_fw`()
  `test_add_lp_and_fw_id`()
  `test_append_wf`()
  `test_append_wf_detour`()
  `test_archive`()
  `test_backgroundtask`()
  `test_basic_fw`()
  `test_basic_fw_offline`()
  `test_category`()
  `test_category_pt2`()
  `test_defuse`()
  `test_delete_fw`()
  `test_dupefinder`()
  `test_duplicate_delete_fw`()
  `test_fibadder`()
  `test_files_in_out`()
  `test_fizzle`()
  `test_force_lock_removal`()
  `test_fw_env`()
  `test_job_info`()
  `test_multi_detour`()
  `test_multi_fw`()
  `test_multi_fw_complex`()
  `test_offline_fw_passinfo`()
  `test_org_wf`()
  `test_parallel_fibadder`()
  `test_preserve_fworker`()
  `test_spec_copy`()
  `test_stats`()

class `fireworks.tests.mongo_tests.` `MultipleDetourTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  `run_task`(fw_spec)

    This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

    Parameters

      fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

    Returns

      (FWAction)

class `fireworks.tests.mongo_tests.` `UpdateSpecTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  `run_task`(fw_spec)

    This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

    Parameters

      fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

    Returns

      (FWAction)

`fireworks.tests.mongo_tests.` `random_launch`(lp_creds)

`fireworks.tests.mongo_tests.` `throw_error`(msg)

## fireworks.tests.multiprocessing_tests module

class `fireworks.tests.multiprocessing_tests.` `TestCheckoutFW`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `lp` = None
  `setUp`()

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

  classmethod `setUpClass`()

    Hook method for setting up class fixture before running tests in the class.

  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  classmethod `tearDownClass`()

    Hook method for deconstructing the class fixture after running all tests in the class.

  `test_checkout_fw`()

class `fireworks.tests.multiprocessing_tests.` `TestEarlyExit`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `lp` = None
  `setUp`()

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

  classmethod `setUpClass`()

    Hook method for setting up class fixture before running tests in the class.

  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  classmethod `tearDownClass`()

    Hook method for deconstructing the class fixture after running all tests in the class.

  `test_early_exit`()

class `fireworks.tests.multiprocessing_tests.` `TestLinks`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_pickle`()

## fireworks.tests.tasks module

TODO: Modify module doc.

class `fireworks.tests.tasks.` `DummyFWEnvTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  `run_task`(fw_spec)

    This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

    Parameters

      fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

    Returns

      (FWAction)

class `fireworks.tests.tasks.` `DummyJobPassTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  `run_task`(fw_spec)

    This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

    Parameters

      fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

    Returns

      (FWAction)

class `fireworks.tests.tasks.` `DummyLPTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  `run_task`(fw_spec)

    This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

    Parameters

      fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

    Returns

      (FWAction)

## fireworks.tests.test_fw_config module

class `fireworks.tests.test_fw_config.` `ConfigTest`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_config`()

## fireworks.tests.test_workflow module

class `fireworks.tests.test_workflow.` `TestWorkflowState`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_archived`()
  `test_completed`()
  `test_defused`()
  `test_fizzled_1`()
  `test_fizzled_2`()
  `test_fizzled_3`()
  `test_fizzled_4`()
  `test_fizzled_5`()
  `test_fizzled_6`()
  `test_paused`()
  `test_ready`()
  `test_reserved`()
  `test_running_1`()
  `test_running_2`()

## Module contents