From 9e0afb2c65f15100eb25996a30cb3e284d729a93 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Fri, 28 Jun 2013 04:35:59 +0300 Subject: [PATCH] [url] Add a test for .title command. --- url.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/url.py b/url.py index 27c461ae30..f60ab595e8 100644 --- a/url.py +++ b/url.py @@ -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 @@ -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 @@ -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__)