adding more tests for the new message fetch route
This commit is contained in:
parent
6ffcb7a73b
commit
c89c2a4469
@ -141,7 +141,11 @@ class Test:
|
|||||||
def creds(self):
|
def creds(self):
|
||||||
return self.body
|
return self.body
|
||||||
|
|
||||||
def auth_tests(worker):
|
def spam_messages(channel, jwt, worker):
|
||||||
|
for _ in range(15):
|
||||||
|
worker.post('/message/send', jwt=jwt, channel=channel, content='dummy post')
|
||||||
|
|
||||||
|
def run(worker):
|
||||||
VOICE_CHAN = 1
|
VOICE_CHAN = 1
|
||||||
TEXT_CHAN = 2
|
TEXT_CHAN = 2
|
||||||
worker.stdout_to_stderr()
|
worker.stdout_to_stderr()
|
||||||
@ -176,6 +180,21 @@ def auth_tests(worker):
|
|||||||
# pass 200
|
# pass 200
|
||||||
worker.get('/meta', jwt=jwt)
|
worker.get('/meta', jwt=jwt)
|
||||||
|
|
||||||
|
|
||||||
|
# Getting messages now
|
||||||
|
# pass 200
|
||||||
|
send_chan = worker.post('/channels/create', jwt=jwt, name=f'{cname}', kind=2, description='some description')
|
||||||
|
send_chan = json.loads(send_chan)
|
||||||
|
# pass 200(all)
|
||||||
|
spam_messages(send_chan['id'], jwt, worker)
|
||||||
|
now = time.time()
|
||||||
|
worker.get('/message/get_range', jwt=jwt, **{
|
||||||
|
'start-time': int(now - 15),
|
||||||
|
'end-time': int(now + 1),
|
||||||
|
'channel': send_chan['id']
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
worker = Test(create_admin=False, init_verbose=True)
|
worker = Test(create_admin=False, init_verbose=True)
|
||||||
auth_tests(worker)
|
run(worker)
|
||||||
|
Loading…
Reference in New Issue
Block a user