From 8e2b52d1c9bc5751ee0a904d9a4fffdaea9a4dd0 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 12 Dec 2020 13:33:21 -0800 Subject: [PATCH] Moving passable tests to their own function for now as we'll need some failing tests soon --- server-api/client-tests/client.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/server-api/client-tests/client.py b/server-api/client-tests/client.py index 38be743..6380a89 100644 --- a/server-api/client-tests/client.py +++ b/server-api/client-tests/client.py @@ -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 @@ -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) +