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

Side by Side Diff: tests/test_fs_source.py

Issue 29465720: Issue 4970 - Document the library API of python-abp (Closed)
Patch Set: Improve the docstrings and help() behavior, shorten the README, add Development documentation and a… Created Oct. 10, 2017, 4:25 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « abp/filters/sources.py ('k') | tests/test_parser.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2017 eyeo GmbH 2 # Copyright (C) 2006-2017 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'))
OLDNEW
« no previous file with comments | « abp/filters/sources.py ('k') | tests/test_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld