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): |
Sebastian Noack
2018/12/29 03:24:56
Shouldn't this rather go in test_web_source.py?
rhowell
2019/01/03 04:42:27
Yeah, looks like it should, but this test is no lo
|
+ with pytest.raises(ValueError): |
+ list(websource.get('')) |