Query string parameter 'type' is now enforced by the api

+ Flag is literally called 'type'
This commit is contained in:
shockrah
2021-03-12 02:17:06 -08:00
parent dc117ba02f
commit 9ce04e96a7
4 changed files with 35 additions and 32 deletions

View File

@@ -171,10 +171,10 @@ def run(worker: Worker):
message_tests = [
# bs message spam
{'init': ['post', '/message/send', {'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200, 'body': True},
{'init': ['post', '/message/send', {'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200},
{'init': ['post', '/message/send', {'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200},
{'init': ['post', '/message/send', {'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200},
{'init': ['post', '/message/send', {'type': 'text', 'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200, 'body': True},
{'init': ['post', '/message/send', {'type': 'text', 'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200},
{'init': ['post', '/message/send', {'type': 'text', 'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200},
{'init': ['post', '/message/send', {'type': 'text', 'channel_id': chan_d['id'], 'content': 'bs content'}], 'auth': jwt, 'hope': 200},
# can we get them back tho?
{
@@ -214,19 +214,14 @@ def run(worker: Worker):
],
'auth': jwt, 'hope': 200, 'body': True
},
# tests that don't follow the api's rules
{
# channel doesn't exist so a 404 seems to be inorder
'init': [
'get', '/message/from_id', {'start': 1, 'channel_id':9}
],
# Channel doesn't exist so empty vector is result
'init': [ 'get', '/message/from_id', {'start': 1, 'channel_id':9} ],
'auth': jwt, 'hope': 404
},
{
'init': [
# good channel but id is tooo high
'get', '/message/from_id', {'start': 5, 'channel_id':3}
],
# Channel id doesn't refer to a real channel
'init': [ 'get', '/message/from_id', {'start': 5, 'channel_id':3} ],
'auth': jwt, 'hope': 404
},
]