Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.lister.opam.tests.test_lister::test_mock_init_repository_update
Failed

TEST RESULT

Run At
Sep 24 2021, 11:30 AM
Details
mock_opam = (<MagicMock name='call' id='140292355140464'>, <MagicMock name='Popen' id='140292354969328'>) tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_mock_init_repository_upda0') datadir = '/var/lib/jenkins/workspace/DLS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/lister/opam/tests/data' def test_mock_init_repository_update(mock_opam, tmp_path, datadir): """Fixture to bypass the actual opam calls within the test context. """ mock_init, mock_popen = mock_opam instance = "fake_opam_repo" instance_url = f"file://{datadir}/{instance}" opam_root = str(tmp_path / "test-opam") os.makedirs(opam_root, exist_ok=True) with open(os.path.join(opam_root, "opam"), "w") as f: f.write("one file to avoid empty folder") assert os.path.exists(opam_root) assert os.listdir(opam_root) == ["opam"] # not empty # This will add a new instance opam_init(opam_root, instance, instance_url, {}) assert mock_init.called > assert mock_init.call_args.args[0] == [ "opam", "repository", "add", "--root", opam_root, instance, instance_url, ] E AssertionError: assert 'args' == ['opam', 'rep...am_repo', ...] E +'args' E -['opam', 'repository', 'add', '--root', '/tmp/pytest-of-jenkins/pytest-0/test_mock_init_repository_upda0/test-opam', 'fake_opam_repo', 'file:///var/lib/jenkins/workspace/DLS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/lister/opam/tests/data/fake_opam_repo'] .tox/py3/lib/python3.7/site-packages/swh/lister/opam/tests/test_lister.py:82: AssertionError