dumy test stats for no reason
This commit is contained in:
parent
93fd8c2cd6
commit
64125a7874
@ -74,6 +74,25 @@ class Worker:
|
|||||||
if self.body_logs[key] is True:
|
if self.body_logs[key] is True:
|
||||||
print(f'\tBody: {self.responses[key].body}')
|
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):
|
def request(self, method: str, path: str, auth: str, opts: dict, expectation: int, show_body=False):
|
||||||
assert(path[0] == '/')
|
assert(path[0] == '/')
|
||||||
@ -228,6 +247,7 @@ def run(worker: Worker):
|
|||||||
worker.request(method, path, auth, opts, hope)
|
worker.request(method, path, auth, opts, hope)
|
||||||
|
|
||||||
worker.logs()
|
worker.logs()
|
||||||
|
worker.test_stats()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
worker = Worker('http://localhost:4536', create_admin=True)
|
worker = Worker('http://localhost:4536', create_admin=True)
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
# Documenting the currently tested / working endpoints
|
|
||||||
|
|
||||||
Mostly a dev reference for now since it's a lot more terse.
|
|
||||||
|
|
||||||
## Parameters
|
|
||||||
|
|
||||||
All parameters are to be passed in via json, other parameters are ignored
|
|
||||||
|
|
||||||
## Auth
|
|
||||||
|
|
||||||
Basically every endpoint except for `/join` and `/meta` require the folowing auth
|
|
||||||
data at a bare minimum.
|
|
||||||
|
|
||||||
* id: u64 -> User id [ Public to the instance ]
|
|
||||||
|
|
||||||
* jwt: String
|
|
||||||
|
|
||||||
To get a JWT you must `POST /login` with the following:
|
|
||||||
|
|
||||||
* id: u64 -> User id [ Public to the instance ]
|
|
||||||
|
|
||||||
* secret: String -> Server generated password
|
|
||||||
|
|
||||||
## Chat api
|
|
||||||
|
|
||||||
`/channels/list` NoPermsRequired
|
|
||||||
|
|
||||||
No parameters required
|
|
||||||
|
|
||||||
`/channels/create` RequiredPerm[CREATE_CHANNEL=64]
|
|
||||||
|
|
||||||
* @Required name: `String`
|
|
||||||
|
|
||||||
* @Required kind: `Signed 32-bit Integer`
|
|
||||||
|
|
||||||
* @Optional description: `String`
|
|
||||||
|
|
||||||
For voice channel `1`. For text channel `2`. All other options result in a HTTP 400.
|
|
||||||
|
|
||||||
|
|
||||||
`/channels/delete` RequiredPerm[DELETE_CHANNEL=128]
|
|
||||||
|
|
||||||
* @Required channel_id: `Unsigned 64-bit Integer`
|
|
||||||
|
|
||||||
`/message/send` RequiredPerm[SEND_MESSAGES=2]
|
|
||||||
|
|
||||||
* @Required channel `Unsigned 64-bit Integer`
|
|
||||||
|
|
||||||
* @Required content `String`
|
|
Loading…
Reference in New Issue
Block a user