dumy test stats for no reason

This commit is contained in:
shockrah
2021-02-21 20:10:14 -08:00
parent 93fd8c2cd6
commit 64125a7874
2 changed files with 20 additions and 49 deletions

View File

@@ -74,6 +74,25 @@ class Worker:
if self.body_logs[key] is True:
print(f'\tBody: {self.responses[key].body}')
def test_stats(self):
passc = 0
failc = 0
total = len(self.responses)
for key in self.responses:
hope = self.responses[key].expected
real = self.responses[key].code
if hope == real:
passc += 1
else:
failc += 1
print('=======')
print(f'\033[1;32mPassing\033[0m {passc}/{total}')
print(f'\033[1;31mFailing\033[0m {failc}/{total}')
print('=======')
def request(self, method: str, path: str, auth: str, opts: dict, expectation: int, show_body=False):
assert(path[0] == '/')
@@ -228,6 +247,7 @@ def run(worker: Worker):
worker.request(method, path, auth, opts, hope)
worker.logs()
worker.test_stats()
if __name__ == '__main__':
worker = Worker('http://localhost:4536', create_admin=True)