add test for expirer processes == process

This is a follow up from a change that improved the error message.

Related-Change: I3d12b79470d122b2114f9ee486b15d381f290f95

Change-Id: I093801f3516a60b298c13e2aa026c11c68a63792
This commit is contained in:
Clay Gerrard 2016-08-25 11:00:49 -07:00
parent 01477c78c1
commit c1ef6539b6

View File

@ -118,6 +118,23 @@ class TestObjectExpirer(TestCase):
x = expirer.ObjectExpirer({})
self.assertRaises(ValueError, x.get_process_values, vals)
def test_get_process_values_process_equal_to_processes(self):
vals = {
'processes': 5,
'process': 5,
}
# from config
x = expirer.ObjectExpirer(vals)
expected_msg = 'process must be less than processes'
with self.assertRaises(ValueError) as ctx:
x.get_process_values({})
self.assertEqual(str(ctx.exception), expected_msg)
# from kwargs
x = expirer.ObjectExpirer({})
with self.assertRaises(ValueError) as ctx:
x.get_process_values(vals)
self.assertEqual(str(ctx.exception), expected_msg)
def test_init_concurrency_too_small(self):
conf = {
'concurrency': 0,