def test_initialisation_valid(self): base = BaseDispatcher('test_subject', 'send_lots', 'send_one', max_batch_size=1) base._aws_service_batch_max_payloads = 1 base._validate_initialisation()
def test_max_batch_too_large_raises_exception(self): base = BaseDispatcher('test_subject', 'send_lots', 'send_one', max_batch_size=2) base._aws_service_batch_max_payloads = 1 with self.assertRaises(ValueError) as context: base._validate_initialisation() self.assertIn( "Requested max_batch_size '2' exceeds the test_subject maximum", str(context.exception))