From: Alfredo Deza Date: Wed, 2 Jul 2014 17:59:27 +0000 (-0400) Subject: fix unused imports in tests X-Git-Tag: v1.5.8~9^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37901470dce4da9da69db32cc7797c7dc267acfe;p=ceph-deploy.git fix unused imports in tests Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/tests/test_cli.py b/ceph_deploy/tests/test_cli.py index 9829ee5..f20b7cf 100644 --- a/ceph_deploy/tests/test_cli.py +++ b/ceph_deploy/tests/test_cli.py @@ -22,7 +22,7 @@ def test_bad_command(tmpdir, cli): result = p.stderr.read() assert 'usage: ceph-deploy' in result assert err.value.status == 2 - assert [p.basename for p in tmpdir.listdir()] == [] + assert [f.basename for f in tmpdir.listdir()] == [] def test_bad_cluster(tmpdir, cli): @@ -34,4 +34,4 @@ def test_bad_cluster(tmpdir, cli): result = p.stderr.read() assert 'usage: ceph-deploy' in result assert err.value.status == 2 - assert [p.basename for p in tmpdir.listdir()] == [] + assert [f.basename for f in tmpdir.listdir()] == [] diff --git a/ceph_deploy/tests/test_cli_install.py b/ceph_deploy/tests/test_cli_install.py index 36129b2..f171973 100644 --- a/ceph_deploy/tests/test_cli_install.py +++ b/ceph_deploy/tests/test_cli_install.py @@ -1,14 +1,6 @@ -import argparse -import collections -import mock import pytest import subprocess -from ..cli import main -from .. import install - -from .directory import directory - def test_help(tmpdir, cli): with cli( diff --git a/ceph_deploy/tests/test_cli_mon.py b/ceph_deploy/tests/test_cli_mon.py index 2b95db3..7d0e4a9 100644 --- a/ceph_deploy/tests/test_cli_mon.py +++ b/ceph_deploy/tests/test_cli_mon.py @@ -5,10 +5,8 @@ import pytest import subprocess from ..cli import main -from .. import mon - from .directory import directory -from .fakes import fake_getaddrinfo + def test_help(tmpdir, cli): with cli( diff --git a/ceph_deploy/tests/test_cli_new.py b/ceph_deploy/tests/test_cli_new.py index 4c7a10d..58922e1 100644 --- a/ceph_deploy/tests/test_cli_new.py +++ b/ceph_deploy/tests/test_cli_new.py @@ -6,7 +6,6 @@ import uuid from .. import conf from ..cli import main from .directory import directory -from .fakes import fake_getaddrinfo def test_help(tmpdir, cli): @@ -32,13 +31,12 @@ def test_write_global_conf_section(tmpdir, cli): def pytest_funcarg__newcfg(request): tmpdir = request.getfuncargvalue('tmpdir') - cli = request.getfuncargvalue('cli') def new(*args): 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)) + main(args=['new'] + list(args)) with tmpdir.join('ceph.conf').open() as f: cfg = conf.ceph.parse(f) return cfg diff --git a/ceph_deploy/tests/test_cli_osd.py b/ceph_deploy/tests/test_cli_osd.py index 195b6dd..39e348b 100644 --- a/ceph_deploy/tests/test_cli_osd.py +++ b/ceph_deploy/tests/test_cli_osd.py @@ -1,14 +1,6 @@ -import argparse -import collections -import mock import pytest import subprocess -from ..cli import main -from .. import osd - -from .directory import directory - def test_help(tmpdir, cli): with cli( diff --git a/ceph_deploy/tests/unit/test_mon.py b/ceph_deploy/tests/unit/test_mon.py index 0bfa442..5ba4136 100644 --- a/ceph_deploy/tests/unit/test_mon.py +++ b/ceph_deploy/tests/unit/test_mon.py @@ -1,6 +1,6 @@ import sys import py.test -from mock import Mock, MagicMock, patch, call +from mock import Mock, patch, call from ceph_deploy import mon from ceph_deploy.tests import fakes from ceph_deploy.hosts.common import mon_create