Verified Commit 3aaada54 authored by Huste, Tobias (FWCC) - 111645's avatar Huste, Tobias (FWCC) - 111645
Browse files

improve tests

parent e1351b9c
Pipeline #842 passed with stage
in 1 minute and 47 seconds
# -*- coding: utf-8 -*-
# This file is part of RODARE.
# Copyright (C) 2017 HZDR.
# RODARE is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
# RODARE is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with RODARE; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
"""Task tests."""
from __future__ import absolute_import, print_function
import mock
import pytest
from celery.exceptions import OperationalError, Retry
from invenio_uploadbyurl.tasks import download_files
def test_download_files(mock_createov, bucket):
"""Test download files celery task."""
mock_createov.side_effect = OperationalError()
with pytest.raises(OperationalError):
download_files.delay(, '')
......@@ -76,6 +76,10 @@ def test_post_api(client, bucket, user):
assert resp.status_code == 202
assert str( in _redisstore.keys()
# test request without given key
url = url_for('invenio_uploadbyurl.uploadbyurl_api',,
resp =
assert resp.status_code == 202
assert str( in _redisstore.keys()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment