From 71d78d8ce1527c3e2b7b06410879dc1e1421c97c Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Sun, 19 Jun 2011 14:04:31 +0530 Subject: [PATCH] Issue #51: Added failing test for full_url method for media files --- hyde/tests/test_site.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hyde/tests/test_site.py b/hyde/tests/test_site.py index e5a1131..a64b7b9 100644 --- a/hyde/tests/test_site.py +++ b/hyde/tests/test_site.py @@ -211,6 +211,20 @@ class TestSiteWithConfig(object): assert not s.is_media('media/css/site.css') assert s.is_media('monkey/css/site.css') + def test_full_url_for_content(self): + s = Site(self.SITE_PATH, config=self.config) + s.load() + path = 'blog/2010/december' + assert s.full_url(path) == "/" + path + + def test_full_url_for_media(self): + s = Site(self.SITE_PATH, config=self.config) + s.load() + path = 'media/css/site.css' + assert s.is_media(path) + full_url = s.full_url(path) + assert full_url == "/" + path + def test_media_url_from_resource(self): s = Site(self.SITE_PATH, config=self.config) s.load() @@ -219,7 +233,7 @@ class TestSiteWithConfig(object): Folder("media").child(path)) assert resource assert resource.full_url == "/media/" + path - + def test_config_ignore(self): s = Site(self.SITE_PATH, config=self.config) s.load()