]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
add tests for the executable not found exception
authorAlfredo Deza <alfredo.deza@inktank.com>
Tue, 8 Jul 2014 14:10:45 +0000 (10:10 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Tue, 8 Jul 2014 14:54:42 +0000 (10:54 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/tests/unit/test_exc.py [new file with mode: 0644]

diff --git a/ceph_deploy/tests/unit/test_exc.py b/ceph_deploy/tests/unit/test_exc.py
new file mode 100644 (file)
index 0000000..cd38686
--- /dev/null
@@ -0,0 +1,16 @@
+from pytest import raises
+from ceph_deploy import exc
+
+
+class TestExecutableNotFound(object):
+
+    def test_executable_is_used(self):
+        with raises(exc.DeployError) as error:
+            raise exc.ExecutableNotFound('vim', 'node1')
+        assert "'vim'" in str(error)
+
+    def test_host_is_used(self):
+        with raises(exc.DeployError) as error:
+            raise exc.ExecutableNotFound('vim', 'node1')
+        assert "node1" in str(error)
+