Browse Source

Addded test for config ignore option

main
Lakshmi Vyasarajan 13 years ago
parent
commit
cf7091c52d
2 changed files with 16 additions and 2 deletions
  1. +3
    -1
      hyde/tests/test_model.py
  2. +13
    -1
      hyde/tests/test_site.py

+ 3
- 1
hyde/tests/test_model.py View File

@@ -110,6 +110,8 @@ class TestConfig(object):
assert c.media_root_path == c.content_root_path.child_folder('media')
assert hasattr(c, 'plugins')
assert len(c.plugins) == 0
assert hasattr(c, 'ignore')
assert c.ignore == ["*~", "*.bak"]
assert c.deploy_root_path == TEST_SITE.child_folder('deploy')
assert c.not_found == '404.html'

@@ -153,4 +155,4 @@ class TestConfig(object):
assert c.content_root_path == TEST_SITE.child_folder('site/stuff')
assert c.media_root_path == c.content_root_path.child_folder('xxx')
assert c.media_url == TEST_SITE.child_folder('/media')
assert c.deploy_root_path == Folder('~/deploy_site')
assert c.deploy_root_path == Folder('~/deploy_site')

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

@@ -218,4 +218,16 @@ class TestSiteWithConfig(object):
resource = s.content.resource_from_relative_path(
Folder("media").child(path))
assert resource
assert resource.full_url == "/media/" + path
assert resource.full_url == "/media/" + path
def test_config_ignore(self):
s = Site(self.SITE_PATH, config=self.config)
s.load()
path = 'apple-touch-icon.png'
resource = s.content.resource_from_relative_path(path)
assert resource
assert resource.full_url == "/" + path
s = Site(self.SITE_PATH, config=self.config)
s.config.ignore.append('*.png')
resource = s.content.resource_from_relative_path(path)
assert not resource

Loading…
Cancel
Save