From 3df7a9f1b46387e0be413dbfa3427e92b5ff28ba Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 7 May 2011 09:39:30 +0200 Subject: [PATCH] Add additional standard path for tools. Node.js tools may be installed in /usr/bin if installed by system package tools or in ~/bin if installed by a default installation of npm. --- hyde/tests/ext/test_less.py | 3 ++- hyde/tests/ext/test_optipng.py | 2 +- hyde/tests/ext/test_stylus.py | 8 +++++--- hyde/tests/ext/test_uglify.py | 9 ++++++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/hyde/tests/ext/test_less.py b/hyde/tests/ext/test_less.py index 1a9cc1a..f8cd849 100644 --- a/hyde/tests/ext/test_less.py +++ b/hyde/tests/ext/test_less.py @@ -29,7 +29,8 @@ 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'] + 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" diff --git a/hyde/tests/ext/test_optipng.py b/hyde/tests/ext/test_optipng.py index 8154880..480e1da 100644 --- a/hyde/tests/ext/test_optipng.py +++ b/hyde/tests/ext/test_optipng.py @@ -31,7 +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'] + 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" diff --git a/hyde/tests/ext/test_stylus.py b/hyde/tests/ext/test_stylus.py index 20facef..1f2af53 100644 --- a/hyde/tests/ext/test_stylus.py +++ b/hyde/tests/ext/test_stylus.py @@ -29,7 +29,8 @@ 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'] + 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" @@ -53,7 +54,8 @@ 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'] + 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" @@ -68,4 +70,4 @@ class TestLess(object): 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() \ No newline at end of file + assert text.strip() == expected_text.strip() diff --git a/hyde/tests/ext/test_uglify.py b/hyde/tests/ext/test_uglify.py index 57d1952..41d4220 100644 --- a/hyde/tests/ext/test_uglify.py +++ b/hyde/tests/ext/test_uglify.py @@ -31,7 +31,8 @@ class TestLess(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'] + 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" @@ -52,7 +53,8 @@ class TestLess(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'] + 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" @@ -74,7 +76,8 @@ class TestLess(object): s = Site(TEST_SITE) s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin'] s.config.mode = "dev" - paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs'] + 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"