From 380171be242a1decedb5014365ccd2f8bd52802a Mon Sep 17 00:00:00 2001 From: Marc Hernandez Cabot Date: Mon, 9 Dec 2019 16:56:06 +0100 Subject: [PATCH 1/4] delete redundant parentheses --- .gitignore | 1 + tests/test_on_fetched_robotstxt.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1cb830b..f51342c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ dist/ # ide .vscode/ +.idea/ \ No newline at end of file diff --git a/tests/test_on_fetched_robotstxt.py b/tests/test_on_fetched_robotstxt.py index 024a893..5374bc9 100644 --- a/tests/test_on_fetched_robotstxt.py +++ b/tests/test_on_fetched_robotstxt.py @@ -6,7 +6,7 @@ from protego import Protego test_data_directory = join(dirname(abspath(__file__)), 'test_data') -robotstxts = [(f) for f in listdir(test_data_directory) if isfile(join(test_data_directory, f))] +robotstxts = [f for f in listdir(test_data_directory) if isfile(join(test_data_directory, f))] @pytest.mark.parametrize('path_to_robotstxt', robotstxts) From a4ee13ac231d2d708e27b5bdf864c3e8fe18d357 Mon Sep 17 00:00:00 2001 From: Marc Hernandez Cabot Date: Mon, 9 Dec 2019 16:56:40 +0100 Subject: [PATCH 2/4] delete statement without effect --- tests/test_unquote.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_unquote.py b/tests/test_unquote.py index 7b6c404..dbf4975 100644 --- a/tests/test_unquote.py +++ b/tests/test_unquote.py @@ -69,7 +69,6 @@ def test_unquoting_plus(self): result = _unquote(given) self.assertEqual(expect, result, "using unquote(): %r != %r" % (expect, result)) - expect = given.replace('+', ' ') def test_unquote_with_unicode(self): # Characters in the Latin-1 range, encoded with UTF-8 From 542b64382c56c89dd9433cc6d2fe35dea909a3f9 Mon Sep 17 00:00:00 2001 From: Marc Hernandez Cabot Date: Mon, 9 Dec 2019 16:58:12 +0100 Subject: [PATCH 3/4] change single quoted docstrings to double-quoted --- tests/test_protego.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_protego.py b/tests/test_protego.py index 5937b18..3364f58 100644 --- a/tests/test_protego.py +++ b/tests/test_protego.py @@ -822,12 +822,12 @@ def test_implicit_allow(self): self.assertFalse(rp.can_fetch("/blahblahblah", "SomeOtherBot")) def test_grouping_unknown_keys(self): - ''' + """ When we encounter unknown keys, we should disregard any grouping that may have happened between user agent rules. This is an example from the wild. `Invalid_directive` not being a valid directive, we'll not consider the '*' and 'ia_archiver' rules together. - ''' + """ content = """ User-agent: abc Disallow: /content/2/ @@ -999,7 +999,7 @@ def test_url_case_sensitivity(self): self.assertTrue(rp.can_fetch("http://foo.bar/x/y", "FooBot")) def test_nonterminal_dollar(self): - '''Non terminal dollar sign should be treated as an odinary character.''' + """Non terminal dollar sign should be treated as an odinary character.""" content = ("user-agent: FooBot\n" "disallow: /x$/abc\n" "disallow: /y/abc$\n" @@ -1016,7 +1016,7 @@ def test_nonterminal_dollar(self): self.assertTrue(rp.can_fetch("http://foo.bar/yabcy/abcdef", "FooBot")) def test_escaped_special_symbols(self): - '''Percent encoded special symbols should be treated as ordinary characters.''' + """Percent encoded special symbols should be treated as ordinary characters.""" content = ("user-agent: FooBot\n" "disallow: /x/abc%24\n" "disallow: /x%2Ax/abc\n") @@ -1029,7 +1029,7 @@ def test_escaped_special_symbols(self): self.assertTrue(rp.can_fetch("http://foo.bar/xabcx/abc", "FooBot")) def test_special_symbols_dual_behaviour(self): - '''Special symbols such as * and $, should also be treated as an ordinary character''' + """Special symbols such as * and $, should also be treated as an ordinary character""" content = ("user-agent: FooBot\n" "disallow: /x/abc$\n" "disallow: /x*x/abc\n") From a62cfba18394e003f9a6e32b6f46b92f29cd0909 Mon Sep 17 00:00:00 2001 From: Marc Hernandez Cabot Date: Tue, 10 Dec 2019 16:28:43 +0100 Subject: [PATCH 4/4] delete IDE entries in .gitignore --- .gitignore | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f51342c..bb8e0a4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,4 @@ dist/ *venv*/ # test -.tox/ - -# ide -.vscode/ -.idea/ \ No newline at end of file +.tox/ \ No newline at end of file