Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into tfw_improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlie committed Jul 29, 2017
2 parents 65afe65 + 1eb1c36 commit 4386572
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
]

r_google_calc = re.compile(r'calculator-40.gif.*? = (.*?)<')
r_google_calc_exp = re.compile(r'calculator-40.gif.*? = (.*?)<sup>(.*?)<')
r_google_calc_exp = re.compile(r'calculator-40.gif.*? = (.*?)<sup>(.*?)</sup></h2>')

def c(phenny, input):
"""Google calculator."""
Expand Down
4 changes: 2 additions & 2 deletions modules/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def help(phenny, input):
"For help with a command, just use .help followed by the name of"
" the command, like \".help botsnack\".")
phenny.say(
"If you need additional help can check out {helpurl} or you can "
"talk to my owner, {owner}.".format(
"If you need additional help, check out {helpurl} or talk to my "
"owner, {owner}.".format(
helpurl=helpurl,
owner=phenny.config.owner))
help.rule = (['help', 'command'], r'(.*)')
Expand Down
2 changes: 1 addition & 1 deletion modules/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def bing(phenny, input):
bing.commands = ['bing']
bing.example = '.bing swhack'

r_duck = re.compile(r'nofollow" class="[^"]+" href=".+?(http.*?)">')
r_duck = re.compile(r'web-result.*?nofollow.*?href=".+?(http.*?)"', re.DOTALL)

def duck_search(query):
query = query.replace('!', '')
Expand Down
6 changes: 6 additions & 0 deletions modules/test/test_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ def test_c_none(self):
c(self.phenny, input)

self.phenny.reply.assert_called_once_with('Sorry, no result.')

def test_c_quirk(self):
input = Mock(group=lambda x: '24/50')
c(self.phenny, input)

self.phenny.say.assert_called_once_with('0.48')
2 changes: 1 addition & 1 deletion modules/test/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def validate(actual_name, actual_lat, actual_lon):
('27959', check_places("Dare County", "North Carolina")),
('48067', check_places("Royal Oak", "Michigan")),
('23606', check_places("Newport News", "Virginia")),
('23113', check_places("Midlothian", "Virginia")),
('23113', check_places("Chesterfield County", "Virginia")),
('27517', check_places("Chapel Hill", "North Carolina")),
('15213', check_places("Allegheny County", "Pennsylvania")),
('90210', check_places("Los Angeles County", "California")),
Expand Down

0 comments on commit 4386572

Please sign in to comment.