Browse Source

Fixed tests for urlencoding content_url and media_url, Issue #88

main
Lakshmi Vyasarajan 13 years ago
parent
commit
0c7fafe07c
2 changed files with 5 additions and 3 deletions
  1. +2
    -1
      hyde/tests/ext/test_textlinks.py
  2. +3
    -2
      hyde/tests/test_site.py

+ 2
- 1
hyde/tests/ext/test_textlinks.py View File

@@ -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

+ 3
- 2
hyde/tests/test_site.py View File

@@ -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)


Loading…
Cancel
Save