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.main
| @@ -29,7 +29,8 @@ 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'] | |||||
| 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] | less = [path for path in paths if File(path).exists] | ||||
| if not less: | if not less: | ||||
| assert False, "Cannot find the lessc executable" | assert False, "Cannot find the lessc executable" | ||||
| @@ -31,7 +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'] | |||||
| paths = ['/usr/local/bin/optipng', '/usr/bin/optipng'] | |||||
| optipng = [path for path in paths if File(path).exists] | optipng = [path for path in paths if File(path).exists] | ||||
| if not optipng: | if not optipng: | ||||
| assert False, "Cannot find the optipng executable" | assert False, "Cannot find the optipng executable" | ||||
| @@ -29,7 +29,8 @@ 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'] | |||||
| paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus', | |||||
| '~/bin/stylus'] | |||||
| stylus = [path for path in paths if File(path).exists] | stylus = [path for path in paths if File(path).exists] | ||||
| if not stylus: | if not stylus: | ||||
| assert False, "Cannot find the stylus executable" | assert False, "Cannot find the stylus executable" | ||||
| @@ -53,7 +54,8 @@ 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'] | |||||
| paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus', | |||||
| '~/bin/stylus'] | |||||
| stylus = [path for path in paths if File(path).exists] | stylus = [path for path in paths if File(path).exists] | ||||
| if not stylus: | if not stylus: | ||||
| assert False, "Cannot find the stylus executable" | assert False, "Cannot find the stylus executable" | ||||
| @@ -68,4 +70,4 @@ 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-compressed.css')).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() | |||||
| @@ -31,7 +31,8 @@ class TestLess(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'] | |||||
| 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] | uglify = [path for path in paths if File(path).exists] | ||||
| if not uglify: | if not uglify: | ||||
| assert False, "Cannot find the uglify executable" | assert False, "Cannot find the uglify executable" | ||||
| @@ -52,7 +53,8 @@ class TestLess(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'] | |||||
| 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] | uglify = [path for path in paths if File(path).exists] | ||||
| if not uglify: | if not uglify: | ||||
| assert False, "Cannot find the uglify executable" | assert False, "Cannot find the uglify executable" | ||||
| @@ -74,7 +76,8 @@ class TestLess(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 = "dev" | 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] | uglify = [path for path in paths if File(path).exists] | ||||
| if not uglify: | if not uglify: | ||||
| assert False, "Cannot find the uglify executable" | assert False, "Cannot find the uglify executable" | ||||