From d31b4393cbd0535913862066ef5d8a31ed6c57b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20Fr=C3=A9cinaux?= Date: Tue, 1 Nov 2011 18:04:09 +0100 Subject: [PATCH] Update tests to use $PATH. --- hyde/tests/ext/test_less.py | 11 ++++------- hyde/tests/ext/test_optipng.py | 7 +------ hyde/tests/ext/test_stylus.py | 24 ++++++++---------------- hyde/tests/ext/test_uglify.py | 12 ++++-------- 4 files changed, 17 insertions(+), 37 deletions(-) diff --git a/hyde/tests/ext/test_less.py b/hyde/tests/ext/test_less.py index f8cd849..f1cb12e 100644 --- a/hyde/tests/ext/test_less.py +++ b/hyde/tests/ext/test_less.py @@ -29,13 +29,10 @@ class TestLess(object): def test_can_execute_less(self): s = Site(TEST_SITE) 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') target = File(Folder(s.config.deploy_root_path).child('media/css/site.css')) gen = Generator(s) diff --git a/hyde/tests/ext/test_optipng.py b/hyde/tests/ext/test_optipng.py index 480e1da..8cb54eb 100644 --- a/hyde/tests/ext/test_optipng.py +++ b/hyde/tests/ext/test_optipng.py @@ -31,12 +31,7 @@ class TestOptipng(object): s = Site(TEST_SITE) s.config.mode = "production" 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')) target = File(Folder(s.config.deploy_root_path).child('media/images/hyde-lt-b.png')) gen = Generator(s) diff --git a/hyde/tests/ext/test_stylus.py b/hyde/tests/ext/test_stylus.py index 039bebf..1f37a1f 100644 --- a/hyde/tests/ext/test_stylus.py +++ b/hyde/tests/ext/test_stylus.py @@ -29,14 +29,10 @@ class TestLess(object): def test_can_execute_stylus(self): s = Site(TEST_SITE) 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') target = File(Folder(s.config.deploy_root_path).child('media/css/site.css')) gen = Generator(s) @@ -51,14 +47,10 @@ class TestLess(object): 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', - '~/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') target = File(Folder(s.config.deploy_root_path).child('media/css/site.css')) gen = Generator(s) diff --git a/hyde/tests/ext/test_uglify.py b/hyde/tests/ext/test_uglify.py index 2bd7175..43a593e 100644 --- a/hyde/tests/ext/test_uglify.py +++ b/hyde/tests/ext/test_uglify.py @@ -31,14 +31,10 @@ class TestUglify(object): s = Site(TEST_SITE) s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin'] 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') target = File(Folder(s.config.deploy_root_path).child('media/js/jquery.js')) gen = Generator(s)