mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[-] Stopped async testing
This commit is contained in:
parent
6832b05230
commit
0fc0c1cdd2
32
unit_test.py
32
unit_test.py
@ -1,5 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
import os
|
||||||
|
|
||||||
|
import file_manager
|
||||||
import firebase_manager
|
import firebase_manager
|
||||||
|
|
||||||
|
|
||||||
@ -11,34 +13,10 @@ def ban_user(user_id: str):
|
|||||||
print("Error banning user " + user_id, "|", str(e), type(e).__name__)
|
print("Error banning user " + user_id, "|", str(e), type(e).__name__)
|
||||||
|
|
||||||
|
|
||||||
async def one() -> int:
|
|
||||||
return 1
|
|
||||||
|
|
||||||
async def two() -> int:
|
|
||||||
await asyncio.sleep(2)
|
|
||||||
return 2
|
|
||||||
|
|
||||||
async def three() -> int:
|
|
||||||
await asyncio.sleep(3)
|
|
||||||
return 3
|
|
||||||
|
|
||||||
coroutines = [
|
|
||||||
one(),
|
|
||||||
two(),
|
|
||||||
three()
|
|
||||||
]
|
|
||||||
async def main() -> None:
|
|
||||||
results = await asyncio.gather(*coroutines)
|
|
||||||
|
|
||||||
#for result in results:
|
|
||||||
# print(result)
|
|
||||||
|
|
||||||
print(f"0: {results[0]}")
|
|
||||||
print(f"1: {results[1]}")
|
|
||||||
print(f"2: {results[2]}")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
#ban_user("MpkbDMOO8PQddQgB5VgBQdTMWF53")
|
#ban_user("MpkbDMOO8PQddQgB5VgBQdTMWF53")
|
||||||
#file_manager.log_action("gqZN3eCHF3V2er3Py3rlgk8u2t83", "test", "DeleteServer")
|
#file_manager.log_action("gqZN3eCHF3V2er3Py3rlgk8u2t83", "test", "DeleteServer")
|
||||||
#firebase_manager.set_servers_not_running()
|
#firebase_manager.set_servers_not_running()
|
||||||
asyncio.run(main())
|
current_dir_content: list[str] = os.listdir(".")
|
||||||
|
parsed_extension: str = '.py'
|
||||||
|
print(file_manager.filter_directory_contents(parsed_extension, current_dir_content))
|
||||||
|
Loading…
Reference in New Issue
Block a user