### Navigation

- index
- modules |
- next |
- previous |
- JSON Link 0.9.2a documentation »
- json_link »
- json_link Package »

# faults Package

## `fault_inject` Module

### Fault Inject

A module that enables easy injection of faults into a JSON link exchange, useful for both our own unit tests and when testing other implementations

Classes:

- `FaultInjectMixIn`
- `MasterFaultInject`
- `SlaveFaultInject`

Related Functions:

Notes:

@author: Bryan Palmintier, NREL 2013

class `json_link.faults.fault_inject.``FaultInjectMixIn`(run_timestep=1.0, run_delay=0.1, run_max=-1, opt_verbose=2, non_sync_retry=None, **Xchg_args)

  Bases: `json_link.json_link._BaseLink`

  Mix in class to enable JSON fault injection by overloading message sending functions

  `fault` = {}
  `sendMsg`(action, data, data_name='data')

    Injects a fault into either the JSON link or raw exchange message by using the fault data field instead of the proper message

  `send_count` = {'init': 0, 'start': 0, 'term': 0, 'output': 0, 'error': 0, 'sync': 0, 'input': 0}

class `json_link.faults.fault_inject.``MasterFaultInject`(in_schema=None, out_schema=None, schema_to_send='', **Other_args)

  Bases: `json_link.json_link.MasterLink`, `json_link.faults.fault_inject.FaultInjectMixIn`

  JSON Link Master/client with fault injection

  `description_dict` = {'application': 'JSON_Link_Master_with_Fault_Inject', 'version': '0.1.0a', 'modelname': '/usr/local/bin/sphinx-build'}

class `json_link.faults.fault_inject.``SlaveFaultInject`(in_schema=None, out_schema=None, **other_args)

  Bases: `json_link.json_link.SlaveLink`, `json_link.faults.fault_inject.FaultInjectMixIn`

  JSON Link Slave/server with fault injection

  `description_dict` = {'version': '0.1.0a', 'remote': 'JSON Link Slave/Server with Fault Inject'}

### Navigation

- index
- modules |
- next |
- previous |
- JSON Link 0.9.2a documentation »
- json_link »
- json_link Package »