From 9a16a6a2e9929098474e0db23db130cf172aeba4 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 22 Jan 2015 14:46:21 -0500 Subject: Use .addCleanup() instead of a .tearDown() where appropriate, although we might have to rewrite this for Python 2.6. Disable Cepko tests (test_cs_util.py) since they are essentially worthless. Convert test_azure to unittest.mock. --- tests/unittests/test_cs_util.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'tests/unittests/test_cs_util.py') diff --git a/tests/unittests/test_cs_util.py b/tests/unittests/test_cs_util.py index 7d59222b..99fac84d 100644 --- a/tests/unittests/test_cs_util.py +++ b/tests/unittests/test_cs_util.py @@ -1,4 +1,4 @@ -from mocker import MockerTestCase +import unittest from cloudinit.cs_utils import Cepko @@ -26,16 +26,21 @@ class CepkoMock(Cepko): return SERVER_CONTEXT['tags'] -class CepkoResultTests(MockerTestCase): +# 2015-01-22 BAW: This test is completely useless because it only ever tests +# the CepkoMock object. Even in its original form, I don't think it ever +# touched the underlying Cepko class methods. +@unittest.skip('This test is completely useless') +class CepkoResultTests(unittest.TestCase): def setUp(self): - self.mocked = self.mocker.replace("cloudinit.cs_utils.Cepko", - spec=CepkoMock, - count=False, - passthrough=False) - self.mocked() - self.mocker.result(CepkoMock()) - self.mocker.replay() - self.c = Cepko() + pass + ## self.mocked = self.mocker.replace("cloudinit.cs_utils.Cepko", + ## spec=CepkoMock, + ## count=False, + ## passthrough=False) + ## self.mocked() + ## self.mocker.result(CepkoMock()) + ## self.mocker.replay() + ## self.c = Cepko() def test_getitem(self): result = self.c.all() -- cgit v1.2.3