From: Travis Rhoden Date: Mon, 25 May 2015 14:04:25 +0000 (-0400) Subject: [RM-11742] Add test for missing host(s) to 'new' cmd X-Git-Tag: v1.5.26~15^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a05143cf23f1d5a482834eae04dd2192293c7547;p=ceph-deploy.git [RM-11742] Add test for missing host(s) to 'new' cmd Signed-off-by: Travis Rhoden --- diff --git a/ceph_deploy/tests/test_cli_new.py b/ceph_deploy/tests/test_cli_new.py index d8a2f5e..a0c67b0 100644 --- a/ceph_deploy/tests/test_cli_new.py +++ b/ceph_deploy/tests/test_cli_new.py @@ -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']