Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.cli.test_client::test_metadata_validation
Failed

TEST RESULT

Run At
Sep 10 2020, 4:11 PM
Details
sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00bq*Q\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1some c...kins/pytest-0/test_metadata_validation0/tmpx62u1f3_', 'length': 128, 'md5sum': '8c3a2f3d2c0a076fbdfeefbaeec631ae', ...} mocker = <pytest_mock.plugin.MockerFixture object at 0x7f6b1685eac8> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6b1685ec50> tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_metadata_validation0' def test_metadata_validation(sample_archive, mocker, caplog, tmp_path): """ from: https://docs.softwareheritage.org/devel/swh-deposit/getting-started.html#single-deposit """ # noqa slug = generate_slug() mocker.patch("swh.deposit.cli.client.generate_slug", return_value=slug) mock_client = MagicMock() mocker.patch("swh.deposit.cli.client._client", return_value=mock_client) mock_client.service_document.return_value = EXAMPLE_SERVICE_DOCUMENT mock_client.deposit_create.return_value = '{"foo": "bar"}' metadata_path = os.path.join(tmp_path, "metadata.xml") mocker.patch( "swh.deposit.cli.client.tempfile.TemporaryDirectory", > return_value=contextlib.nullcontext(str(tmp_path)), ) .tox/py3/lib/python3.7/site-packages/swh/deposit/tests/cli/test_client.py:215: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/pytest_mock/plugin.py:341: in __call__ **kwargs .tox/py3/lib/python3.7/site-packages/pytest_mock/plugin.py:182: in _start_patch mocked = p.start() # type: unittest.mock.MagicMock /usr/lib/python3.7/unittest/mock.py:1399: in start result = self.__enter__() /usr/lib/python3.7/unittest/mock.py:1252: in __enter__ self.target = self.getter() /usr/lib/python3.7/unittest/mock.py:1422: in <lambda> getter = lambda: _importer(target) /usr/lib/python3.7/unittest/mock.py:1109: in _importer thing = _dot_lookup(thing, comp, import_path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ thing = <module 'swh.deposit.cli.client' from '/var/lib/jenkins/workspace/DDEP/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/deposit/cli/client.py'> comp = 'tempfile', import_path = 'swh.deposit.cli.client.tempfile' def _dot_lookup(thing, comp, import_path): try: return getattr(thing, comp) except AttributeError: > __import__(import_path) E ModuleNotFoundError: No module named 'swh.deposit.cli.client.tempfile'; 'swh.deposit.cli.client' is not a package /usr/lib/python3.7/unittest/mock.py:1098: ModuleNotFoundError