From 4ef28d2128b409682cadf3ad78e0708a280e0147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81opaciuk?= Date: Thu, 14 Dec 2017 10:50:40 +0100 Subject: [PATCH] tests: naming nad don't load directly from file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Szymon Łopaciuk --- tests/unit/test_oaipmh.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/unit/test_oaipmh.py b/tests/unit/test_oaipmh.py index 42420f1b..6db74b4c 100644 --- a/tests/unit/test_oaipmh.py +++ b/tests/unit/test_oaipmh.py @@ -8,7 +8,6 @@ # more details. from datetime import datetime -import json from mock import patch import pytest @@ -61,9 +60,6 @@ def test_load_last_run(spider, cleanup): now = datetime.utcnow() spider._save_run(started_at=now) - file_path = spider._last_run_file_path() - result = override_dynamic_fields(json.load(open(file_path))) - expected = override_dynamic_fields({ 'spider': 'OAI-PMH', 'url': 'http://0.0.0.0/oai2', @@ -75,14 +71,12 @@ def test_load_last_run(spider, cleanup): 'last_run_finished_at': '2017-12-08T13:55:00.000000', }) - assert expected == result - result = override_dynamic_fields(spider._load_last_run()) assert expected == result -def test_load_nonexistent(spider): +def test_load_last_run_nonexistent(spider): with pytest.raises(NoLastRunToLoad): spider._load_last_run()