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

Delta Between Two Patch Sets: tests/test_fs_source.py

Issue 29465720: Issue 4970 - Document the library API of python-abp (Closed)
Left Patch Set: Update README to match the changes from https://codereview.adblockplus.org/29465715/ Created Aug. 7, 2017, 8:28 p.m.
Right Patch Set: Rebase to match the new master and retouche the docstrings. Created Oct. 24, 2017, 4:06 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 # This file is part of Adblock Plus <https://adblockplus.org/>, 1 # This file is part of Adblock Plus <https://adblockplus.org/>,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details. 11 # GNU General Public License for more details.
12 # 12 #
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
15 15
16 import pytest 16 import pytest
17 17
18 from abp.filters import FSSource, NotFound 18 from abp.filters.sources import FSSource, NotFound
19 19
20 20
21 @pytest.fixture 21 @pytest.fixture
22 def fssource_dir(tmpdir): 22 def fssource_dir(tmpdir):
23 tmpdir.mkdir('root') 23 tmpdir.mkdir('root')
24 not_in_source = tmpdir.join('not-in-source.txt') 24 not_in_source = tmpdir.join('not-in-source.txt')
25 not_in_source.write('! secret') 25 not_in_source.write('! secret')
26 root = tmpdir.join('root') 26 root = tmpdir.join('root')
27 root.mkdir('foo') 27 root.mkdir('foo')
28 foobar = root.join('foo', 'bar.txt') 28 foobar = root.join('foo', 'bar.txt')
(...skipping 11 matching lines...) Expand all
40 40
41 41
42 def test_escape_source(fssource): 42 def test_escape_source(fssource):
43 with pytest.raises(ValueError): 43 with pytest.raises(ValueError):
44 list(fssource.get('../not-in-source.txt')) 44 list(fssource.get('../not-in-source.txt'))
45 45
46 46
47 def test_read_missing_file(fssource): 47 def test_read_missing_file(fssource):
48 with pytest.raises(NotFound): 48 with pytest.raises(NotFound):
49 list(fssource.get('foo/baz.txt')) 49 list(fssource.get('foo/baz.txt'))
LEFTRIGHT

Powered by Google App Engine
This is Rietveld