Moving passable tests to their own function for now as we'll need some failing tests soon
This commit is contained in:
parent
4e657e2710
commit
8e2b52d1c9
@ -11,7 +11,7 @@ class Response:
|
|||||||
return f'{self.code} => {self.body}'
|
return f'{self.code} => {self.body}'
|
||||||
|
|
||||||
class Test:
|
class Test:
|
||||||
def __init__(self, base='http://localhost:8888', create_admin=False, admin=None):
|
def __init__(self, base='http://localhost:8888', create_admin=False, admin=None, init_verbose=False):
|
||||||
'''
|
'''
|
||||||
@opt:base = base url string
|
@opt:base = base url string
|
||||||
@opt:create_admin = creates admin account directly off cargo -c <NAME>
|
@opt:create_admin = creates admin account directly off cargo -c <NAME>
|
||||||
@ -22,6 +22,8 @@ class Test:
|
|||||||
self.test_count = 0
|
self.test_count = 0
|
||||||
if create_admin:
|
if create_admin:
|
||||||
self.body = Test.__create_admin()
|
self.body = Test.__create_admin()
|
||||||
|
if init_verbose:
|
||||||
|
print(f'Using => {self.body}')
|
||||||
elif admin is not None:
|
elif admin is not None:
|
||||||
self.body = body
|
self.body = body
|
||||||
else:
|
else:
|
||||||
@ -98,12 +100,9 @@ class Test:
|
|||||||
def creds(self):
|
def creds(self):
|
||||||
return self.body
|
return self.body
|
||||||
|
|
||||||
|
def base_working_tests(worker):
|
||||||
if __name__ == '__main__':
|
print('')
|
||||||
worker = Test(create_admin=True)
|
|
||||||
|
|
||||||
# First the invites api gets some basic tests
|
# First the invites api gets some basic tests
|
||||||
worker.get('/invite/create')
|
|
||||||
|
|
||||||
# Channels things
|
# Channels things
|
||||||
VOICE_CHANNEL = 1
|
VOICE_CHANNEL = 1
|
||||||
@ -124,3 +123,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
worker.post('/message/send', channel=msg_chan['id'], content="some random content")
|
worker.post('/message/send', channel=msg_chan['id'], content="some random content")
|
||||||
worker.delete('/channels/delete', channel_id=msg_chan['id']) # finally clean up the channel we created
|
worker.delete('/channels/delete', channel_id=msg_chan['id']) # finally clean up the channel we created
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
worker = Test(create_admin=True, init_verbose=True)
|
||||||
|
base_working_tests(worker)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user