From 999297b3167299077f237f57bfdb47c629396928 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Sun, 9 Apr 2017 23:15:25 -0700 Subject: [PATCH] Python 3.4+ is now required --- README.md | 2 +- modules/search.py | 11 ----------- modules/test/test_search.py | 9 +-------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index b5b6487..a5818a3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ will need to be updated to run on Python3 if they do not already. All of the core modules have been ported, removed, or replaced. ## Requirements -* Python 3.2+ +* Python 3.4+ * [python-requests](http://docs.python-requests.org/en/latest/) ## Installation diff --git a/modules/search.py b/modules/search.py index 22d6188..18d13af 100644 --- a/modules/search.py +++ b/modules/search.py @@ -184,16 +184,5 @@ def search(phenny, input): phenny.reply(result) search.commands = ['search'] -def suggest(phenny, input): - if not input.group(2): - return phenny.reply("No query term.") - query = input.group(2) - uri = 'http://websitedev.de/temp-bin/suggest.pl?q=' - answer = web.get(uri + web.quote(query).replace('+', '%2B')) - if answer: - phenny.say(answer) - else: phenny.reply('Sorry, no result.') -suggest.commands = ['suggest'] - if __name__ == '__main__': print(__doc__.strip()) diff --git a/modules/test/test_search.py b/modules/test/test_search.py index 10281ba..bd13cd0 100644 --- a/modules/test/test_search.py +++ b/modules/test/test_search.py @@ -8,7 +8,7 @@ import unittest from mock import MagicMock, Mock from modules.search import duck_api, google_search, google_count, \ formatnumber, g, gc, gcs, bing_search, bing, duck_search, duck, \ - search, suggest + search class TestSearch(unittest.TestCase): @@ -75,10 +75,3 @@ class TestSearch(unittest.TestCase): duck(self.phenny, input) assert self.phenny.reply.called is True - - def test_suggest(self): - input = Mock(group=lambda x: 'vtluug') - suggest(self.phenny, input) - - assert (self.phenny.reply.called is True or \ - self.phenny.say.called is True)