name mode size
.. 100644 836B 100755 5.84kB 100755 833B
# Python Mocking Framework for testing # Generate a mocking framework base on the output of app_python.api_list Usage: ``` /usr/sbin/kamctl rpc app_python.api_list > api.json ./ api.json > ``` *Note:* Python 3.2 doesn't support the Union type. To generate without the Union type add the --no-union flag ``` ./ api.json --no-union > ``` Return values can be injected through the dictionary \_mock\_data ```python #set retun value for all calls to the function _mock_data[module][function] = value #set retun value for specific parameters being passed _mock_data[module][function][param_value] = value #call the function myFunc when func is passed, return of myFunc will #be the value module.function returns _mock_data[module][function] = myFunc ``` see for example usage