Fix bug where use of 'exclude' config option would cause exception
This commit is contained in:
parent
ad3a832a16
commit
c6407478e7
@ -359,7 +359,7 @@ def filters(section=None):
|
|||||||
urllib.quote(filter(section)))
|
urllib.quote(filter(section)))
|
||||||
if exclude(section):
|
if exclude(section):
|
||||||
filters.append('regexp_sifter.py?exclude=' +
|
filters.append('regexp_sifter.py?exclude=' +
|
||||||
urllib.quote(filter(section)))
|
urllib.quote(exclude(section)))
|
||||||
return filters
|
return filters
|
||||||
|
|
||||||
def planet_options():
|
def planet_options():
|
||||||
|
2
tests/data/filter/regexp-sifter2.ini
Normal file
2
tests/data/filter/regexp-sifter2.ini
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Planet]
|
||||||
|
exclude=two
|
@ -111,6 +111,25 @@ class FilterTests(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertNotEqual('', output)
|
self.assertNotEqual('', output)
|
||||||
|
|
||||||
|
def test_regexp_filter2(self):
|
||||||
|
config.load('tests/data/filter/regexp-sifter2.ini')
|
||||||
|
|
||||||
|
testfile = 'tests/data/filter/category-one.xml'
|
||||||
|
|
||||||
|
output = open(testfile).read()
|
||||||
|
for filter in config.filters():
|
||||||
|
output = shell.run(filter, output, mode="filter")
|
||||||
|
|
||||||
|
self.assertNotEqual('', output)
|
||||||
|
|
||||||
|
testfile = 'tests/data/filter/category-two.xml'
|
||||||
|
|
||||||
|
output = open(testfile).read()
|
||||||
|
for filter in config.filters():
|
||||||
|
output = shell.run(filter, output, mode="filter")
|
||||||
|
|
||||||
|
self.assertEqual('', output)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user