From 14bf191b9765455336b895844a1c407ff4b1dd2a Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 17 Jul 2013 15:30:23 -0400 Subject: [PATCH] remove invalid test --- ceph_deploy/test/test_cli_new.py | 38 ++++++++++---------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/ceph_deploy/test/test_cli_new.py b/ceph_deploy/test/test_cli_new.py index cb2aba6..23ea2db 100644 --- a/ceph_deploy/test/test_cli_new.py +++ b/ceph_deploy/test/test_cli_new.py @@ -1,9 +1,13 @@ import pytest +from mock import patch import re import subprocess import uuid from .. import conf +from ..cli import main +from .directory import directory +from .fakes import fake_getaddrinfo def test_help(tmpdir, cli): @@ -11,39 +15,21 @@ def test_help(tmpdir, cli): args=['ceph-deploy', 'new', '--help'], stdout=subprocess.PIPE, ) as p: - got = p.stdout.read() - assert got == """\ -usage: ceph-deploy new [-h] [MON [MON ...]] + result = p.stdout.read() + assert 'usage: ceph-deploy new' in result + assert 'positional arguments' in result + assert 'optional arguments' in result -Start deploying a new cluster, and write a CLUSTER.conf for it. -positional arguments: - MON initial monitor hosts - -optional arguments: - -h, --help show this help message and exit -""" - - -def test_simple(tmpdir, cli): - with cli( - args=['ceph-deploy', 'new'], - ): - pass - assert {p.basename for p in tmpdir.listdir()} == {'ceph.conf'} +def test_write_global_conf_section(tmpdir, cli): + with patch('ceph_deploy.new.socket.getaddrinfo', fake_getaddrinfo): + with directory(str(tmpdir)): + main(args=['new', 'host1']) with tmpdir.join('ceph.conf').open() as f: cfg = conf.parse(f) assert cfg.sections() == ['global'] -def test_named(tmpdir, cli): - with cli( - args=['ceph-deploy', '--cluster=foo', 'new'], - ): - pass - assert {p.basename for p in tmpdir.listdir()} == {'foo.conf'} - - def test_exists(tmpdir, cli): with cli( args=['ceph-deploy', 'new'], -- 2.47.3