]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
remove invalid test
authorAlfredo Deza <alfredo@deza.pe>
Wed, 17 Jul 2013 19:30:23 +0000 (15:30 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Wed, 17 Jul 2013 19:30:23 +0000 (15:30 -0400)
ceph_deploy/test/test_cli_new.py

index cb2aba614b77f7089b4b8fcef77e441ceff8842b..23ea2db1f029741d24c1f349912923faf60d49e6 100644 (file)
@@ -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'],