Minor improvement to updater unit tests
Follow up for change I7c57bba053711a27d3802efe6f2a0bf53483a54f The current tests won't prevent this kind of regression in the updaters' __init__ methods: self.node_timeout = int(float(conf.get('node_timeout', 10))) so this makes them a little tighter. Change-Id: I60bd79ac392deb1e8a108357d48474dddd9028c1
This commit is contained in:
parent
b6b7578190
commit
5d8d2e98ee
@ -64,14 +64,14 @@ class TestContainerUpdater(unittest.TestCase):
|
|||||||
'swift_dir': self.testdir,
|
'swift_dir': self.testdir,
|
||||||
'interval': '1',
|
'interval': '1',
|
||||||
'concurrency': '2',
|
'concurrency': '2',
|
||||||
'node_timeout': '5.',
|
'node_timeout': '5.5',
|
||||||
})
|
})
|
||||||
self.assertTrue(hasattr(cu, 'logger'))
|
self.assertTrue(hasattr(cu, 'logger'))
|
||||||
self.assertTrue(cu.logger is not None)
|
self.assertTrue(cu.logger is not None)
|
||||||
self.assertEqual(cu.devices, self.devices_dir)
|
self.assertEqual(cu.devices, self.devices_dir)
|
||||||
self.assertEqual(cu.interval, 1)
|
self.assertEqual(cu.interval, 1)
|
||||||
self.assertEqual(cu.concurrency, 2)
|
self.assertEqual(cu.concurrency, 2)
|
||||||
self.assertEqual(cu.node_timeout, 5.)
|
self.assertEqual(cu.node_timeout, 5.5)
|
||||||
self.assertTrue(cu.get_account_ring() is not None)
|
self.assertTrue(cu.get_account_ring() is not None)
|
||||||
|
|
||||||
@mock.patch.object(container_updater, 'ismount')
|
@mock.patch.object(container_updater, 'ismount')
|
||||||
|
@ -84,13 +84,13 @@ class TestObjectUpdater(unittest.TestCase):
|
|||||||
'swift_dir': self.testdir,
|
'swift_dir': self.testdir,
|
||||||
'interval': '1',
|
'interval': '1',
|
||||||
'concurrency': '2',
|
'concurrency': '2',
|
||||||
'node_timeout': '5.'})
|
'node_timeout': '5.5'})
|
||||||
self.assertTrue(hasattr(cu, 'logger'))
|
self.assertTrue(hasattr(cu, 'logger'))
|
||||||
self.assertTrue(cu.logger is not None)
|
self.assertTrue(cu.logger is not None)
|
||||||
self.assertEqual(cu.devices, self.devices_dir)
|
self.assertEqual(cu.devices, self.devices_dir)
|
||||||
self.assertEqual(cu.interval, 1)
|
self.assertEqual(cu.interval, 1)
|
||||||
self.assertEqual(cu.concurrency, 2)
|
self.assertEqual(cu.concurrency, 2)
|
||||||
self.assertEqual(cu.node_timeout, 5.)
|
self.assertEqual(cu.node_timeout, 5.5)
|
||||||
self.assertTrue(cu.get_container_ring() is not None)
|
self.assertTrue(cu.get_container_ring() is not None)
|
||||||
|
|
||||||
@mock.patch('os.listdir')
|
@mock.patch('os.listdir')
|
||||||
|
Loading…
Reference in New Issue
Block a user