From 00fccb72e525ecd8efe4103a31d2e29231160d95 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 20 Jan 2021 22:50:23 -0800 Subject: [PATCH] Mysterious tuple from string bug here Patching because I have other things to do but basically this diff at line 20 shows that even though self.secret was assigned toa string value, it was still being given the type of tuple with the first/only item being the string value I have no idea how this was happeneing but its fixed as of now * also im ignoring the cargo_bin flag in the environment for now as its just causing issues while debugging --- server-api/client-tests/client.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/server-api/client-tests/client.py b/server-api/client-tests/client.py index d8a2f0a..3635c28 100644 --- a/server-api/client-tests/client.py +++ b/server-api/client-tests/client.py @@ -18,30 +18,16 @@ class Worker: self.responses = {} self.jwt = None # never gets assigned until /login is hit - if create_admin: - self.basic_creds = self.__create_admin() - # two most important details for basically everything - self.id = self.body['id'] - self.secret = self.body['secret'] - else: - # for now we use this because my dev server has this fake ass acc on it - self.secret = 'mH7DfAfSLHhVbo9OW4dmqTbzzLnFaZQLxoZFIlKvKHm4NfpLyZsZrYdf12aACZXyEQxELOlBTe2rc36vTPVd8A==', - self.id = 2 - - # This is to never be overwritten - self.basic_creds = { - 'name': 'owner sama uwu', - 'joindate': 69, - 'status': 0, - 'permissions': 18446744073709551615 - } + self.basic_creds = self.__create_admin() + self.id = self.basic_creds['id'] + self.secret = self.basic_creds['secret'] def __create_admin(self): # /home/$user/.cargo/bin/cargo <- normally # NOTE: the above path is prolly some awful shit on ci pipeline CARGO_BIN = os.getenv('CARGO_BIN') - proc = subprocess.run(f'{CARGO_BIN} run --release -- -c dev-test'.split(), text=True, capture_output=True) + proc = subprocess.run(f'cargo run --release -- -c dev-test'.split(), text=True, capture_output=True) try: return json.loads(proc.stdout) except: @@ -136,5 +122,5 @@ def run(worker: Worker): if __name__ == '__main__': - worker = Worker('http://localhost:8888', create_admin=False) + worker = Worker('http://localhost:8888', create_admin=True) run(worker)