event_schema: Extract check_subscription_remove.

This commit is contained in:
Steve Howell
2020-07-08 12:20:25 +00:00
committed by Tim Abbott
parent 055f1a590d
commit 502f1b9fe2
2 changed files with 24 additions and 11 deletions

View File

@@ -230,3 +230,20 @@ def check_subscription_add(
assert "subscribers" in sub.keys()
else:
assert "subscribers" not in sub.keys()
_check_remove_sub = check_dict_only(
required_keys=[
# We should eventually just return stream_id here.
("name", check_string),
("stream_id", check_int),
]
)
check_subscription_remove = check_events_dict(
required_keys=[
("type", equals("subscription")),
("op", equals("remove")),
("subscriptions", check_list(_check_remove_sub)),
]
)