Skip to content

Commit

Permalink
update test script
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdzumair committed Jan 2, 2024
1 parent 59560d5 commit 78a5c76
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import asyncio
import json

import httpx

from pikpakapi import PikPakApi
import asyncio


async def test():
client = PikPakApi(
username="your_username",
password="your_password",
proxy="127.0.0.1:7890",
httpx_client_args={
"proxy": "http://127.0.0.1:1081",
"transport": httpx.AsyncHTTPTransport(retries=3),
},
)
await client.login()
print(json.dumps(client.get_user_info(), indent=4))
Expand Down Expand Up @@ -35,45 +41,44 @@ async def test():

print(
json.dumps(
await client.file_rename("VNayNjZtsdmka4YrwZWVj-r4o1", '[Nekomoe kissaten][Deaimon][11][1080p][CHS]_01.mp4'), indent=4
await client.file_rename(
"VNayNjZtsdmka4YrwZWVj-r4o1",
"[Nekomoe kissaten][Deaimon][11][1080p][CHS]_01.mp4",
),
indent=4,
)
)
print("=" * 30, end="\n\n")

print(
json.dumps(
await client.file_batch_star(ids=['VN6qSS-FBcaI6l7YltWsjUU1o1']), indent=4
await client.file_batch_star(ids=["VN6qSS-FBcaI6l7YltWsjUU1o1"]), indent=4
)
)
print("=" * 30, end="\n\n")

print(
json.dumps(
await client.file_batch_unstar(ids=['VN6qSS-FBcaI6l7YltWsjUU1o1']), indent=4
await client.file_batch_unstar(ids=["VN6qSS-FBcaI6l7YltWsjUU1o1"]), indent=4
)
)
print("=" * 30, end="\n\n")

print(
json.dumps(
await client.file_star_list(), indent=4
)
)
print(json.dumps(await client.file_star_list(), indent=4))
print("=" * 30, end="\n\n")

print(
json.dumps(
await client.file_batch_share(ids=['VN6qSS-FBcaI6l7YltWsjUU1o1'], need_password=True)
await client.file_batch_share(
ids=["VN6qSS-FBcaI6l7YltWsjUU1o1"], need_password=True
)
)
)
print("=" * 30, end="\n\n")

print(
json.dumps(
await client.get_quota_info(), indent=4
)
)
print(json.dumps(await client.get_quota_info(), indent=4))
print("=" * 30, end="\n\n")


if __name__ == "__main__":
asyncio.run(test())

0 comments on commit 78a5c76

Please sign in to comment.