Skip to content

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Oct 22, 2020
1 parent 2bb1b78 commit 54aa8e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/test_flattend_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ def test_extension_error():
'file_name': 'file',
'url': 'http://example.com/example/file'
}

with pytest.raises(StopIteration):
next(generator)
11 changes: 10 additions & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from kingfisher_scrapy.util import get_parameter_value, replace_parameters
from kingfisher_scrapy.util import components, get_parameter_value, replace_parameters


@pytest.mark.parametrize('url,value,expected', [
Expand All @@ -20,3 +20,12 @@ def test_replace_parameters(url, value, expected):
])
def test_get_parameter_value(url, expected):
assert get_parameter_value(url, 'page') == expected


@pytest.mark.parametrize('url,expected', [
('http://example.com/example/file.json', 'file'),
('http://example.com/example/file.xlsx', 'file'),
('http://example.com/example/file.csv', 'file'),
])
def test_components(url, expected):
assert components(-1)(url) == expected

0 comments on commit 54aa8e6

Please sign in to comment.