9036e1eb5f
Proposing adding [H210] hacking check in tox.ini to require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls. This patch adds missing 'autospec' or 'spec_set' to unit tests in /tests/unit/objects/. By using autospec=True assert errors can be caught. [H210] requires that some value for autospec, spec, or spec_set is defined. It could be autospec=False. autospec=True doesn't work on staticmethods: https://bugs.python.org/issue23078 For those cases, using spec_set=types.FunctionType. More patches to follow to cover all the unit tests to enable [H210] in tox.ini. Change-Id: I142b49b092520d453b85db25c2c5f197ff85f3eb |
||
---|---|---|
.. | ||
__init__.py | ||
test_chassis.py | ||
test_conductor.py | ||
test_fields.py | ||
test_node.py | ||
test_notification.py | ||
test_objects.py | ||
test_port.py | ||
test_portgroup.py | ||
test_volume_connector.py | ||
test_volume_target.py | ||
utils.py |