Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_fs_source.py

Issue 29968569: Issue 4014 - Publish python-abp on PyPI (Closed) Base URL: https://hg.adblockplus.org/python-abp/
Patch Set: Address comments on PS2, add README ToC Created Dec. 29, 2018, 1:29 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « setup.py ('k') | tests/test_web_source.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_fs_source.py
===================================================================
--- a/tests/test_fs_source.py
+++ b/tests/test_fs_source.py
@@ -15,7 +15,7 @@
import pytest
-from abp.filters.sources import FSSource, NotFound
+from abp.filters.sources import FSSource, NotFound, WebSource
@pytest.fixture
@@ -35,6 +35,11 @@
return FSSource(fssource_dir)
+@pytest.fixture
+def websource(fssource_dir):
+ return WebSource(fssource_dir)
+
+
def test_read_file(fssource):
assert list(fssource.get('foo/bar.txt')) == ['! foo/bar.txt', '! end']
@@ -47,3 +52,13 @@
def test_read_missing_file(fssource):
with pytest.raises(NotFound):
list(fssource.get('foo/baz.txt'))
+
+
+def test_fssource_get_err(fssource):
+ with pytest.raises(IOError):
+ list(fssource.get(''))
+
+
+def test_websource_get_err(websource):
+ with pytest.raises(ValueError):
+ list(websource.get(''))
« no previous file with comments | « setup.py ('k') | tests/test_web_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld