diff options
author | George Kraft <george.kraft@calxeda.com> | 2013-12-07 12:14:23 -0600 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2013-12-07 12:14:23 -0600 |
commit | 76084a9b7e3b7f09aecd404dbb803a3bb6a1d4c4 (patch) | |
tree | 79cfa374dd6d599980d3c2333de3150331f083de | |
parent | 7af4294fbd7e214f669adc6ded77dadb627c41f9 (diff) | |
download | cxmanage-76084a9b7e3b7f09aecd404dbb803a3bb6a1d4c4.tar.gz |
CXMAN-263: Remove the cxmanage_api.dummy package
Put the dummies back in cxmanage_api.tests. They kinda go together.
-rw-r--r-- | cxmanage_api/tests/__init__.py | 37 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy.py (renamed from cxmanage_api/dummy/dummy.py) | 0 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy_bmc.py (renamed from cxmanage_api/dummy/dummy_bmc.py) | 3 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy_image.py (renamed from cxmanage_api/dummy/dummy_image.py) | 0 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy_ip_retriever.py (renamed from cxmanage_api/dummy/dummy_ip_retriever.py) | 0 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy_node.py (renamed from cxmanage_api/dummy/dummy_node.py) | 3 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy_test.py | 2 | ||||
-rw-r--r-- | cxmanage_api/tests/dummy_ubootenv.py (renamed from cxmanage_api/dummy/dummy_ubootenv.py) | 0 | ||||
-rw-r--r-- | cxmanage_api/tests/fabric_test.py | 2 | ||||
-rw-r--r-- | cxmanage_api/tests/node_test.py | 2 | ||||
-rw-r--r-- | cxmanage_api/tests/utilities.py (renamed from cxmanage_api/dummy/__init__.py) | 35 | ||||
-rw-r--r-- | setup.py | 3 |
12 files changed, 42 insertions, 45 deletions
diff --git a/cxmanage_api/tests/__init__.py b/cxmanage_api/tests/__init__.py index d8d5307..bf136c0 100644 --- a/cxmanage_api/tests/__init__.py +++ b/cxmanage_api/tests/__init__.py @@ -1,6 +1,3 @@ -"""Calxeda: __init__.py""" - - # Copyright (c) 2012-2013, Calxeda Inc. # # All rights reserved. @@ -31,30 +28,10 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. - -import os -import random -import tempfile - -from cxmanage_api.image import Image - -def random_file(size): - """ Create a random file """ - contents = "".join([chr(random.randint(0, 255)) for _ in range(size)]) - file_, filename = tempfile.mkstemp(prefix='cxmanage_test-') - with os.fdopen(file_, "w") as file_handle: - file_handle.write(contents) - - return filename - -class TestImage(Image): - """TestImage Class.""" - def verify(self): - return True - -# pylint: disable=R0903 -class TestSensor(object): - """ Sensor result from bmc/target """ - def __init__(self, sensor_name, sensor_reading): - self.sensor_name = sensor_name - self.sensor_reading = sensor_reading +from cxmanage_api.tests.utilities import random_file, TestImage, TestSensor +from cxmanage_api.tests.dummy import Dummy +from cxmanage_api.tests.dummy_bmc import DummyBMC +from cxmanage_api.tests.dummy_node import DummyNode, DummyFailNode +from cxmanage_api.tests.dummy_image import DummyImage +from cxmanage_api.tests.dummy_ubootenv import DummyUbootEnv +from cxmanage_api.tests.dummy_ip_retriever import DummyIPRetriever diff --git a/cxmanage_api/dummy/dummy.py b/cxmanage_api/tests/dummy.py index 72f04ed..72f04ed 100644 --- a/cxmanage_api/dummy/dummy.py +++ b/cxmanage_api/tests/dummy.py diff --git a/cxmanage_api/dummy/dummy_bmc.py b/cxmanage_api/tests/dummy_bmc.py index d43728a..cc515db 100644 --- a/cxmanage_api/dummy/dummy_bmc.py +++ b/cxmanage_api/tests/dummy_bmc.py @@ -36,11 +36,10 @@ from mock import Mock from pyipmi import IpmiError from pyipmi.bmc import LanBMC -from cxmanage_api.tests import TestSensor +from cxmanage_api.tests import Dummy, TestSensor from cxmanage_api import temp_file from cxmanage_api.simg import create_simg, get_simg_header from cxmanage_api.tftp import InternalTftp, ExternalTftp -from cxmanage_api.dummy import Dummy # pylint: disable=R0902 diff --git a/cxmanage_api/dummy/dummy_image.py b/cxmanage_api/tests/dummy_image.py index 534befa..534befa 100644 --- a/cxmanage_api/dummy/dummy_image.py +++ b/cxmanage_api/tests/dummy_image.py diff --git a/cxmanage_api/dummy/dummy_ip_retriever.py b/cxmanage_api/tests/dummy_ip_retriever.py index 4767856..4767856 100644 --- a/cxmanage_api/dummy/dummy_ip_retriever.py +++ b/cxmanage_api/tests/dummy_ip_retriever.py diff --git a/cxmanage_api/dummy/dummy_node.py b/cxmanage_api/tests/dummy_node.py index 4d4aa3a..02af2c2 100644 --- a/cxmanage_api/dummy/dummy_node.py +++ b/cxmanage_api/tests/dummy_node.py @@ -31,8 +31,7 @@ import random from cxmanage_api.ubootenv import UbootEnv -from cxmanage_api.tests import TestSensor -from cxmanage_api.dummy import Dummy, DummyBMC +from cxmanage_api.tests import Dummy, DummyBMC, TestSensor from cxmanage_api.node import Node diff --git a/cxmanage_api/tests/dummy_test.py b/cxmanage_api/tests/dummy_test.py index c445272..8012ed2 100644 --- a/cxmanage_api/tests/dummy_test.py +++ b/cxmanage_api/tests/dummy_test.py @@ -1,6 +1,6 @@ import unittest from mock import Mock, call -from cxmanage_api.dummy import Dummy +from cxmanage_api.tests import Dummy class DummyTest(unittest.TestCase): diff --git a/cxmanage_api/dummy/dummy_ubootenv.py b/cxmanage_api/tests/dummy_ubootenv.py index a937419..a937419 100644 --- a/cxmanage_api/dummy/dummy_ubootenv.py +++ b/cxmanage_api/tests/dummy_ubootenv.py diff --git a/cxmanage_api/tests/fabric_test.py b/cxmanage_api/tests/fabric_test.py index 6008388..3863186 100644 --- a/cxmanage_api/tests/fabric_test.py +++ b/cxmanage_api/tests/fabric_test.py @@ -38,7 +38,7 @@ from cxmanage_api.fabric import Fabric from cxmanage_api.tftp import InternalTftp, ExternalTftp from cxmanage_api.firmware_package import FirmwarePackage from cxmanage_api.cx_exceptions import CommandFailedError -from cxmanage_api.dummy import DummyNode, DummyFailNode +from cxmanage_api.tests import DummyNode, DummyFailNode # pylint: disable=R0904 diff --git a/cxmanage_api/tests/node_test.py b/cxmanage_api/tests/node_test.py index e692e3e..1bbd6bc 100644 --- a/cxmanage_api/tests/node_test.py +++ b/cxmanage_api/tests/node_test.py @@ -37,8 +37,8 @@ import tempfile import unittest from mock import call +from cxmanage_api.tests import DummyBMC, DummyUbootEnv, DummyIPRetriever from cxmanage_api.tests import TestImage, random_file -from cxmanage_api.dummy import DummyBMC, DummyUbootEnv, DummyIPRetriever from cxmanage_api.node import Node from cxmanage_api.firmware_package import FirmwarePackage diff --git a/cxmanage_api/dummy/__init__.py b/cxmanage_api/tests/utilities.py index ff8a7ac..6a405d7 100644 --- a/cxmanage_api/dummy/__init__.py +++ b/cxmanage_api/tests/utilities.py @@ -28,9 +28,32 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. -from cxmanage_api.dummy.dummy import Dummy -from cxmanage_api.dummy.dummy_bmc import DummyBMC -from cxmanage_api.dummy.dummy_node import DummyNode, DummyFailNode -from cxmanage_api.dummy.dummy_image import DummyImage -from cxmanage_api.dummy.dummy_ubootenv import DummyUbootEnv -from cxmanage_api.dummy.dummy_ip_retriever import DummyIPRetriever +import os +import random +import tempfile + +from cxmanage_api.image import Image + + +def random_file(size): + """ Create a random file """ + contents = "".join([chr(random.randint(0, 255)) for _ in range(size)]) + file_, filename = tempfile.mkstemp(prefix='cxmanage_test-') + with os.fdopen(file_, "w") as file_handle: + file_handle.write(contents) + + return filename + + +class TestImage(Image): + """TestImage Class.""" + def verify(self): + return True + + +# pylint: disable=R0903 +class TestSensor(object): + """ Sensor result from bmc/target """ + def __init__(self, sensor_name, sensor_reading): + self.sensor_name = sensor_name + self.sensor_reading = sensor_reading @@ -49,8 +49,7 @@ setup( 'cxmanage_api', 'cxmanage_api.cli', 'cxmanage_api.cli.commands', - 'cxmanage_api.tests', - 'cxmanage_api.dummy' + 'cxmanage_api.tests' ], scripts=['scripts/cxmanage', 'scripts/sol_tabs', 'scripts/cxmux'], description='Calxeda Management Utility', |