Browse Source

Issue #51: Added failing test for full_url method for media files

main
Lakshmi Vyasarajan 13 years ago
parent
commit
71d78d8ce1
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      hyde/tests/test_site.py

+ 15
- 1
hyde/tests/test_site.py View File

@@ -211,6 +211,20 @@ class TestSiteWithConfig(object):
assert not s.is_media('media/css/site.css') assert not s.is_media('media/css/site.css')
assert s.is_media('monkey/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): def test_media_url_from_resource(self):
s = Site(self.SITE_PATH, config=self.config) s = Site(self.SITE_PATH, config=self.config)
s.load() s.load()
@@ -219,7 +233,7 @@ class TestSiteWithConfig(object):
Folder("media").child(path)) Folder("media").child(path))
assert resource assert resource
assert resource.full_url == "/media/" + path assert resource.full_url == "/media/" + path
def test_config_ignore(self): def test_config_ignore(self):
s = Site(self.SITE_PATH, config=self.config) s = Site(self.SITE_PATH, config=self.config)
s.load() s.load()


Loading…
Cancel
Save