]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-11742] Add test for missing host(s) to 'new' cmd
authorTravis Rhoden <trhoden@redhat.com>
Mon, 25 May 2015 14:04:25 +0000 (10:04 -0400)
committerTravis Rhoden <trhoden@redhat.com>
Mon, 25 May 2015 14:04:25 +0000 (10:04 -0400)
Signed-off-by: Travis Rhoden <trhoden@redhat.com>
ceph_deploy/tests/test_cli_new.py

index d8a2f5eb3a14120a4a406ff72cc1a25da4d558e6..a0c67b0eb5bc2b28d9884a44ad8cd1fc70f09dac 100644 (file)
@@ -2,6 +2,7 @@ import re
 import subprocess
 import uuid
 
+import pytest
 from mock import patch
 
 from ceph_deploy import conf
@@ -20,6 +21,18 @@ def test_help(tmpdir, cli):
     assert 'optional arguments' in result
 
 
+def test_bad_no_mon(tmpdir, cli):
+    with pytest.raises(cli.Failed) as err:
+        with cli(
+            args=['ceph-deploy', 'new'],
+            stderr=subprocess.PIPE,
+            ) as p:
+            result = p.stderr.read()
+    assert 'usage: ceph-deploy new' in result
+    assert 'too few arguments' in result
+    assert err.value.status == 2
+
+
 def test_write_global_conf_section(tmpdir, cli):
     fake_ip_addresses = lambda x: ['10.0.0.1']