def test_import_image_retry(monkeypatch):

    runner = prepare(retry_delay=1)

    build_json = {"metadata": {}}
    monkeypatch.setenv("BUILD", json.dumps(build_json))

    (flexmock(OSBS)
     .should_receive('get_image_stream')
     .once()
     .with_args(TEST_IMAGESTREAM))
    (flexmock(OSBS)
     .should_receive('create_image_stream')
     .never())
    (flexmock(OSBS)
     .should_receive('import_image')
     .twice()
     .with_args(TEST_IMAGESTREAM)
     .and_return(False)
     .and_return(True))
    runner.run()
Test retrying importing tags for an existing ImageStream
dataset/ETHPy150Open projectatomic/atomic-reactor/tests/plugins/test_import_image.py/test_import_image_retry