From: Travis Rhoden Date: Wed, 24 Jun 2015 22:33:19 +0000 (-0700) Subject: [RM-11742] Add argparse tests for mon destroy X-Git-Tag: v1.5.26~14^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f6ddf2a0f6b1e334b6bed5df2c7ebac8111d829;p=ceph-deploy.git [RM-11742] Add argparse tests for mon destroy Signed-off-by: Travis Rhoden --- diff --git a/ceph_deploy/tests/parser/test_mon.py b/ceph_deploy/tests/parser/test_mon.py index 8dbd0f7..9a115f8 100644 --- a/ceph_deploy/tests/parser/test_mon.py +++ b/ceph_deploy/tests/parser/test_mon.py @@ -110,3 +110,24 @@ class TestParserMON(object): def test_mon_add_multi_host_raises_err(self): with pytest.raises(SystemExit): self.parser.parse_args('mon add test1 test2'.split()) + + @pytest.mark.skipif(reason="http://tracker.ceph.com/issues/12151") + def test_mon_destroy_help(self, capsys): + with pytest.raises(SystemExit): + self.parser.parse_args('mon destroy --help'.split()) + out, err = capsys.readouterr() + assert 'usage: ceph-deploy mon destroy' in out + + @pytest.mark.skipif(reason="http://tracker.ceph.com/issues/12151") + def test_mon_destroy_no_host_raises_err(self): + with pytest.raises(SystemExit): + self.parser.parse_args('mon destroy'.split()) + + def test_mon_destroy_one_host_okay(self): + args = self.parser.parse_args('mon destroy test1'.split()) + assert args.mon == ["test1"] + + def test_mon_destroy_multi_host(self): + hosts = ['host1', 'host2', 'host3'] + args = self.parser.parse_args('mon destroy'.split() + hosts) + assert args.mon == hosts