@pytest.fixture
def swh_storage():
"""An swh-storage object that gets injected into the CLI functions."""
storage = get_storage(**CLI_CONFIG["storage"])
> with patch("swh.storage.cli.get_storage") as get_storage_mock:
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_cli.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/unittest/mock.py:1268: in __enter__
original, local = self.get_original()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <unittest.mock._patch object at 0x7f05c653eb70>
def get_original(self):
target = self.getter()
name = self.attribute
original = DEFAULT
local = False
try:
original = target.__dict__[name]
except (AttributeError, KeyError):
original = getattr(target, name, DEFAULT)
else:
local = True
if name in _builtins and isinstance(target, ModuleType):
self.create = True
if not self.create and original is DEFAULT:
raise AttributeError(
> "%s does not have the attribute %r" % (target, name)
)
E AttributeError: <module 'swh.storage.cli' from '/var/lib/jenkins/workspace/DSTO/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/storage/cli.py'> does not have the attribute 'get_storage'
/usr/lib/python3.7/unittest/mock.py:1242: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Sep 10 2020, 4:30 PM