Skip to content
Browse files

Fix solo.py's cookbook_path's import

  • Loading branch information...
1 parent 9e76425 commit 608a9dacd325eb391927036218d2a8240dd7ab58 @tobami committed Oct 26, 2012
Showing with 13 additions and 2 deletions.
  1. +1 −1 littlechef/solo.py
  2. +12 −1 tests/test_lib.py
View
2 littlechef/solo.py
@@ -21,8 +21,8 @@
from fabric.contrib.files import append, exists, upload_template
from fabric.utils import abort
+from littlechef import cookbook_paths
from littlechef.lib import credentials
-from littlechef.settings import cookbook_paths
from littlechef import LOGFILE as logging_path
View
13 tests/test_lib.py
@@ -24,7 +24,7 @@
env_path = "/".join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1])
sys.path.insert(0, env_path)
-from littlechef import runner, chef, lib
+from littlechef import runner, chef, lib, solo
littlechef_src = os.path.split(os.path.normpath(os.path.abspath(__file__)))[0]
@@ -117,6 +117,17 @@ def test_nodes_all_in_env(self):
self.assertEqual(runner.env.hosts, ['testnode2'])
+class TestSolo(BaseTest):
+ def test_configure_no_sudo_rights(self):
+ """Should abort when user has no sudo rights"""
+ env.host_string = "extranode"
+ with patch.object(solo, 'exists') as mock_exists:
+ mock_exists.return_value = False
+ with patch.object(solo, 'sudo') as mock_sudo:
+ mock_sudo.failed = True
+ self.assertRaises(SystemExit, solo.configure)
+
+
class TestLib(BaseTest):
def test_get_node(self):
"""Should get data for a given node, empty when it doesn't exist"""

0 comments on commit 608a9da

Please sign in to comment.
Something went wrong with that request. Please try again.