Moving passable tests to their own function for now as we'll need some failing tests soon

This commit is contained in:
shockrah 2020-12-12 13:33:21 -08:00
parent 4e657e2710
commit 8e2b52d1c9

View File

@ -11,7 +11,7 @@ class Response:
return f'{self.code} => {self.body}'
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:create_admin = creates admin account directly off cargo -c <NAME>
@ -22,6 +22,8 @@ class Test:
self.test_count = 0
if create_admin:
self.body = Test.__create_admin()
if init_verbose:
print(f'Using => {self.body}')
elif admin is not None:
self.body = body
else:
@ -98,12 +100,9 @@ class Test:
def creds(self):
return self.body
if __name__ == '__main__':
worker = Test(create_admin=True)
def base_working_tests(worker):
print('')
# First the invites api gets some basic tests
worker.get('/invite/create')
# Channels things
VOICE_CHANNEL = 1
@ -124,3 +123,9 @@ if __name__ == '__main__':
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
if __name__ == '__main__':
worker = Test(create_admin=True, init_verbose=True)
base_working_tests(worker)