From 0c7fafe07c108f9d93c78c022f83b2881420dac6 Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Wed, 9 Nov 2011 14:11:10 +0530 Subject: [PATCH] Fixed tests for urlencoding content_url and media_url, Issue #88 --- hyde/tests/ext/test_textlinks.py | 3 ++- hyde/tests/test_site.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hyde/tests/ext/test_textlinks.py b/hyde/tests/ext/test_textlinks.py index f06aa49..fd214c2 100644 --- a/hyde/tests/ext/test_textlinks.py +++ b/hyde/tests/ext/test_textlinks.py @@ -7,6 +7,7 @@ Use nose from hyde.fs import File, Folder from hyde.generator import Generator from hyde.site import Site +from urllib import quote from pyquery import PyQuery @@ -56,5 +57,5 @@ class TestTextlinks(object): html = f.read_all() assert html for name, path in d.items(): - assert site.config.base_url + path in html + assert quote(site.config.base_url + path) in html assert '/media/img/hyde-logo.png' in html \ No newline at end of file diff --git a/hyde/tests/test_site.py b/hyde/tests/test_site.py index a64b7b9..181d697 100644 --- a/hyde/tests/test_site.py +++ b/hyde/tests/test_site.py @@ -5,6 +5,7 @@ Use nose `$ nosetests` """ import yaml +from urllib import quote from hyde.fs import File, Folder from hyde.model import Config, Expando @@ -60,9 +61,9 @@ def test_node_full_url(): r = RootNode(TEST_SITE_ROOT.child_folder('content'), s) assert not r.module n = r.add_node(TEST_SITE_ROOT.child_folder('content/blog')) - assert n.full_url == 'http://localhost/blog' + assert n.full_url == quote('http://localhost/blog') c = r.add_node(TEST_SITE_ROOT.child_folder('content/blog/2010/december')) - assert c.full_url == 'http://localhost/blog/2010/december' + assert c.full_url == quote('http://localhost/blog/2010/december') def test_node_relative_path(): s = Site(TEST_SITE_ROOT)