def test_bad_no_conf(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'mon'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read().decode('utf-8') assert 'usage: ceph-deploy' in result assert_too_few_arguments(result) assert err.value.status == 2
def test_calamari_connect_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('calamari connect'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_new_mon_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('new'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_disk_prepare_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('disk prepare'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_valid_subcommands_with_args(self, cmd, capsys): with pytest.raises(SystemExit): self.parser.parse_args(['%s' % cmd]) out, err = capsys.readouterr() assert_too_few_arguments(err) assert 'invalid choice' not in err
def test_config_pull_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('config pull'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_osd_list_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('osd list'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_osd_create_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('osd create'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_disk_zap_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('disk zap'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_gatherkeys_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args("gatherkeys".split()) out, err = capsys.readouterr() assert_too_few_arguments(err)
def test_pkg_remove_host_required(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('pkg --remove pkg1'.split()) out, err = capsys.readouterr() assert_too_few_arguments(err)