From 0fa6815277ffe5aaf2288385457a201760788d7b Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 3 Mar 2014 16:55:07 -0500 Subject: [PATCH] fix conf changes for test_cli_new Signed-off-by: Alfredo Deza --- ceph_deploy/tests/test_cli_new.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ceph_deploy/tests/test_cli_new.py b/ceph_deploy/tests/test_cli_new.py index 8f6cda8..4c7a10d 100644 --- a/ceph_deploy/tests/test_cli_new.py +++ b/ceph_deploy/tests/test_cli_new.py @@ -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 -- 2.47.3