]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
fix conf changes for test_cli_new
authorAlfredo Deza <alfredo.deza@inktank.com>
Mon, 3 Mar 2014 21:55:07 +0000 (16:55 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Mon, 3 Mar 2014 21:55:07 +0000 (16:55 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/tests/test_cli_new.py

index 8f6cda821857a74358c9d38cd7905bcc8abfba4d..4c7a10d97fb90ff7c5849f7678a2c7bb34eb4c42 100644 (file)
@@ -1,4 +1,3 @@
-import pytest
 from mock import patch
 import re
 import subprocess
@@ -22,12 +21,12 @@ def test_help(tmpdir, cli):
 
 
 def test_write_global_conf_section(tmpdir, cli):
-    with patch('ceph_deploy.new.socket.gethostbyname'):
-        with patch('ceph_deploy.new.socket.getaddrinfo', fake_getaddrinfo):
+    with patch('ceph_deploy.new.net.get_nonlocal_ip', lambda x: '10.0.0.1'):
+        with patch('ceph_deploy.new.arg_validators.Hostname', lambda: lambda x: x):
             with directory(str(tmpdir)):
                 main(args=['new', 'host1'])
     with tmpdir.join('ceph.conf').open() as f:
-        cfg = conf.parse(f)
+        cfg = conf.ceph.parse(f)
     assert cfg.sections() == ['global']
 
 
@@ -36,12 +35,12 @@ def pytest_funcarg__newcfg(request):
     cli = request.getfuncargvalue('cli')
 
     def new(*args):
-        with patch('ceph_deploy.new.socket.gethostbyname'):
-            with patch('ceph_deploy.new.socket.getaddrinfo', fake_getaddrinfo):
+        with patch('ceph_deploy.new.net.get_nonlocal_ip', lambda x: '10.0.0.1'):
+            with patch('ceph_deploy.new.arg_validators.Hostname', lambda: lambda x: x):
                 with directory(str(tmpdir)):
                     main( args=['new'] + list(args))
                     with tmpdir.join('ceph.conf').open() as f:
-                        cfg = conf.parse(f)
+                        cfg = conf.ceph.parse(f)
                     return cfg
     return new