test_events: Start using test_dict_only.

This is a proof of concept; we'll want to migrate the rest of the call
points soon.
This commit is contained in:
Tim Abbott
2017-03-25 23:13:01 -07:00
parent 2160088d94
commit db92dec05e

View File

@@ -84,7 +84,7 @@ from zerver.lib.test_classes import (
ZulipTestCase, ZulipTestCase,
) )
from zerver.lib.validator import ( from zerver.lib.validator import (
check_bool, check_dict, check_float, check_int, check_list, check_string, check_bool, check_dict, check_dict_only, check_float, check_int, check_list, check_string,
equals, check_none_or, Validator equals, check_none_or, Validator
) )
@@ -315,10 +315,11 @@ class EventsRegisterTest(ZulipTestCase):
def realm_bot_schema(self, field_name, check): def realm_bot_schema(self, field_name, check):
# type: (str, Validator) -> Validator # type: (str, Validator) -> Validator
return check_dict([ return check_dict_only([
('id', check_int),
('type', equals('realm_bot')), ('type', equals('realm_bot')),
('op', equals('update')), ('op', equals('update')),
('bot', check_dict([ ('bot', check_dict_only([
('email', check_string), ('email', check_string),
('user_id', check_int), ('user_id', check_int),
(field_name, check), (field_name, check),