Skip to content

Commit

Permalink
Merge pull request #36 from seomoz/dan/query-only-directive
Browse files Browse the repository at this point in the history
Support a query-only directive
  • Loading branch information
Dan Lecocq authored Nov 11, 2016
2 parents 4a50aa6 + d8bf6c5 commit 28fc42b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reppy/rep-cpp
Submodule rep-cpp updated 2 files
+1 −1 deps/url-cpp
+14 −0 test/test-agent.cpp
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

setup(
name = 'reppy',
version = '0.4.1',
version = '0.4.2',
description = 'Replacement robots.txt Parser',
long_description = '''Replaces the built-in robotsparser with a
RFC-conformant implementation that supports modern robots.txt constructs like
Expand Down
18 changes: 18 additions & 0 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,21 @@ def test_accepts_full_url(self):
Disallow: /path;params?query
''', 'agent')
self.assertFalse(agent.allowed('http://exmaple.com/path;params?query'))

def test_query_only(self):
'''Recognized query-only rules.'''
agent = self.parse('''
User-agent: agent
Disallow: /?
''', 'agent')
self.assertFalse(agent.allowed('/?'))
self.assertTrue(agent.allowed('/'))

def test_params_only(self):
'''Recognized params-only rules.'''
agent = self.parse('''
User-agent: agent
Disallow: /;
''', 'agent')
self.assertFalse(agent.allowed('/;'))
self.assertTrue(agent.allowed('/'))

0 comments on commit 28fc42b

Please sign in to comment.