Browse Source

Update tests to use $PATH.

main
Steve Frécinaux 13 years ago
parent
commit
d31b4393cb
4 changed files with 17 additions and 37 deletions
  1. +4
    -7
      hyde/tests/ext/test_less.py
  2. +1
    -6
      hyde/tests/ext/test_optipng.py
  3. +8
    -16
      hyde/tests/ext/test_stylus.py
  4. +4
    -8
      hyde/tests/ext/test_uglify.py

+ 4
- 7
hyde/tests/ext/test_less.py View File

@@ -29,13 +29,10 @@ class TestLess(object):
def test_can_execute_less(self): def test_can_execute_less(self):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.less.LessCSSPlugin'] s.config.plugins = ['hyde.ext.plugins.less.LessCSSPlugin']
paths = ['/usr/local/share/npm/bin/lessc', '~/local/bin/lessc',
'/usr/bin/lessc', '~/bin/lessc']
less = [path for path in paths if File(path).exists]
if not less:
assert False, "Cannot find the lessc executable"
less = less[0]
s.config.less = Expando(dict(app=less))
paths = ['/usr/local/share/npm/bin/lessc']
for path in paths:
if File(path).exists:
s.config.less = Expando(dict(app=path))
source = TEST_SITE.child('content/media/css/site.less') source = TEST_SITE.child('content/media/css/site.less')
target = File(Folder(s.config.deploy_root_path).child('media/css/site.css')) target = File(Folder(s.config.deploy_root_path).child('media/css/site.css'))
gen = Generator(s) gen = Generator(s)


+ 1
- 6
hyde/tests/ext/test_optipng.py View File

@@ -31,12 +31,7 @@ class TestOptipng(object):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.mode = "production" s.config.mode = "production"
s.config.plugins = ['hyde.ext.plugins.optipng.OptiPNGPlugin'] s.config.plugins = ['hyde.ext.plugins.optipng.OptiPNGPlugin']
paths = ['/usr/local/bin/optipng', '/usr/bin/optipng']
optipng = [path for path in paths if File(path).exists]
if not optipng:
assert False, "Cannot find the optipng executable"
optipng = optipng[0]
s.config.optipng = Expando(dict(app=optipng, args=dict(quiet="")))
s.config.optipng = Expando(dict(args=dict(quiet="")))
source =File(TEST_SITE.child('content/media/images/hyde-lt-b.png')) source =File(TEST_SITE.child('content/media/images/hyde-lt-b.png'))
target = File(Folder(s.config.deploy_root_path).child('media/images/hyde-lt-b.png')) target = File(Folder(s.config.deploy_root_path).child('media/images/hyde-lt-b.png'))
gen = Generator(s) gen = Generator(s)


+ 8
- 16
hyde/tests/ext/test_stylus.py View File

@@ -29,14 +29,10 @@ class TestLess(object):
def test_can_execute_stylus(self): def test_can_execute_stylus(self):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin'] s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus',
'~/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))
paths = ['/usr/local/share/npm/bin/stylus']
for path in paths:
if File(path).exists:
s.config.stylus = Expando(dict(app=path))
source = TEST_SITE.child('content/media/css/site.styl') source = TEST_SITE.child('content/media/css/site.styl')
target = File(Folder(s.config.deploy_root_path).child('media/css/site.css')) target = File(Folder(s.config.deploy_root_path).child('media/css/site.css'))
gen = Generator(s) gen = Generator(s)
@@ -51,14 +47,10 @@ class TestLess(object):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.mode = "production" s.config.mode = "production"
s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin'] s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus',
'~/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))
paths = ['/usr/local/share/npm/bin/stylus']
for path in paths:
if File(path).exists:
s.config.stylus = Expando(dict(app=path))
source = TEST_SITE.child('content/media/css/site.styl') source = TEST_SITE.child('content/media/css/site.styl')
target = File(Folder(s.config.deploy_root_path).child('media/css/site.css')) target = File(Folder(s.config.deploy_root_path).child('media/css/site.css'))
gen = Generator(s) gen = Generator(s)


+ 4
- 8
hyde/tests/ext/test_uglify.py View File

@@ -31,14 +31,10 @@ class TestUglify(object):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin'] s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin']
s.config.mode = "production" s.config.mode = "production"
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs',
'/usr/bin/uglifyjs', '~/bin/uglifyjs']
uglify = [path for path in paths if File(path).exists]
if not uglify:
assert False, "Cannot find the uglify executable"

uglify = uglify[0]
s.config.uglify = Expando(dict(app=uglify))
paths = ['/usr/local/share/npm/bin/uglifyjs']
for path in paths:
if File(path).exists:
s.config.uglify = Expando(dict(app=path))
source = TEST_SITE.child('content/media/js/jquery.js') source = TEST_SITE.child('content/media/js/jquery.js')
target = File(Folder(s.config.deploy_root_path).child('media/js/jquery.js')) target = File(Folder(s.config.deploy_root_path).child('media/js/jquery.js'))
gen = Generator(s) gen = Generator(s)


Loading…
Cancel
Save