Change from unittest to testtools
part of bug 1177924 Change-Id: I99be2c48dc7143015883b89130083c8ea11abeec Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
This commit is contained in:
		| @@ -213,8 +213,8 @@ class Connection(base.Connection): | |||||||
|                     try: |                     try: | ||||||
|                         from ming import mim |                         from ming import mim | ||||||
|                     except ImportError: |                     except ImportError: | ||||||
|                         import nose |                         import testtools | ||||||
|                         raise nose.SkipTest("Ming not found") |                         raise testtools.testcase.TestSkipped('requires mim') | ||||||
|                     LOG.debug('Creating a new MIM Connection object') |                     LOG.debug('Creating a new MIM Connection object') | ||||||
|                     Connection._mim_instance = mim.Connection() |                     Connection._mim_instance = mim.Connection() | ||||||
|                 self.conn = Connection._mim_instance |                 self.conn = Connection._mim_instance | ||||||
| @@ -564,8 +564,8 @@ def require_map_reduce(conn): | |||||||
|         try: |         try: | ||||||
|             from ming import mim |             from ming import mim | ||||||
|             if hasattr(conn, "conn") and isinstance(conn.conn, mim.Connection): |             if hasattr(conn, "conn") and isinstance(conn.conn, mim.Connection): | ||||||
|                 import nose |                 import testtools | ||||||
|                 raise nose.SkipTest('requires spidermonkey') |                 raise testtools.testcase.TestSkipped('requires spidermonkey') | ||||||
|         except ImportError: |         except ImportError: | ||||||
|             import nose |             import testtools | ||||||
|             raise nose.SkipTest('requires mim') |             raise testtools.testcase.TestSkipped('requires mim') | ||||||
|   | |||||||
| @@ -18,17 +18,15 @@ | |||||||
| # under the License. | # under the License. | ||||||
| """Test base classes. | """Test base classes. | ||||||
| """ | """ | ||||||
|  |  | ||||||
| import unittest2 |  | ||||||
|  |  | ||||||
| import mox | import mox | ||||||
| from oslo.config import cfg | from oslo.config import cfg | ||||||
| import stubout | import stubout | ||||||
|  | import testtools | ||||||
|  |  | ||||||
| cfg.CONF.import_opt('pipeline_cfg_file', 'ceilometer.pipeline') | cfg.CONF.import_opt('pipeline_cfg_file', 'ceilometer.pipeline') | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestCase(unittest2.TestCase): | class TestCase(testtools.TestCase): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestCase, self).setUp() |         super(TestCase, self).setUp() | ||||||
|   | |||||||
| @@ -108,6 +108,6 @@ class TestNotifier(tests_base.TestCase): | |||||||
|  |  | ||||||
|         self.assertEqual(len(pub.counters), 0) |         self.assertEqual(len(pub.counters), 0) | ||||||
|         notifier.notify(None, MESSAGE) |         notifier.notify(None, MESSAGE) | ||||||
|         self.assertGreater(len(pub.counters), 0) |         self.assertTrue(len(pub.counters) > 0) | ||||||
|         self.assertIn('disk.ephemeral.size', |         self.assertIn('disk.ephemeral.size', | ||||||
|                       [c.name for c in pub.counters]) |                       [c.name for c in pub.counters]) | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| nose | nose | ||||||
| unittest2 |  | ||||||
| coverage | coverage | ||||||
| mock | mock | ||||||
| mox | mox | ||||||
| @@ -17,3 +16,4 @@ netifaces | |||||||
| sphinx | sphinx | ||||||
| docutils==0.9.1 # for bug 1091333, remove after sphinx >1.1.3 is released. | docutils==0.9.1 # for bug 1091333, remove after sphinx >1.1.3 is released. | ||||||
| python-spidermonkey | python-spidermonkey | ||||||
|  | testtools>=0.9.29 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Angus Salkeld
					Angus Salkeld