Browse Source

Added test for stylus compression

main
Lakshmi Vyasarajan 13 years ago
parent
commit
5401c0efc4
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      hyde/tests/ext/test_stylus.py

+ 21
- 0
hyde/tests/ext/test_stylus.py View File

@@ -44,4 +44,25 @@ class TestLess(object):
assert target.exists assert target.exists
text = target.read_all() text = target.read_all()
expected_text = File(STYLUS_SOURCE.child('expected-site.css')).read_all() expected_text = File(STYLUS_SOURCE.child('expected-site.css')).read_all()
assert text.strip() == expected_text.strip()

def test_can_compress_with_stylus(self):
s = Site(TEST_SITE)
s.config.mode = "production"
s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus']
stylus = [path for path in paths if File(path).exists]
if not stylus:
assert False, "Cannot find the stylus executable"

stylus = stylus[0]
s.config.stylus = Expando(dict(app=stylus))
source = TEST_SITE.child('content/media/css/site.styl')
target = File(Folder(s.config.deploy_root_path).child('media/css/site.css'))
gen = Generator(s)
gen.generate_resource_at_path(source)

assert target.exists
text = target.read_all()
expected_text = File(STYLUS_SOURCE.child('expected-site-compressed.css')).read_all()
assert text.strip() == expected_text.strip() assert text.strip() == expected_text.strip()

Loading…
Cancel
Save