Skip to content

Commit

Permalink
[url] Add a test for .title command.
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-koivula committed Jun 28, 2013
1 parent f1ca3f0 commit 9e0afb2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion url.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import re
from htmlentitydefs import name2codepoint
from willie import web, tools
from willie.module import commands, rule
from willie.module import commands, rule, example
import urlparse

url_finder = None
Expand Down Expand Up @@ -75,6 +75,7 @@ def setup(bot):


@commands('title')
@example('.title http://google.com', '[ Google ] - google.com')
def title_command(bot, trigger):
"""
Show the title or URL information for the given URL, or the last URL seen
Expand Down Expand Up @@ -259,3 +260,8 @@ def iri_to_uri(iri):
part.encode('idna') if parti == 1 else urlEncodeNonAscii(part.encode('utf-8'))
for parti, part in enumerate(parts)
)


if __name__ == "__main__":
from willie.test_tools import run_example_tests
run_example_tests(__file__)

0 comments on commit 9e0afb2

Please sign in to comment.