discord-havoc/tests/uploader_tests.py

32 lines
656 B
Python
Raw Permalink Normal View History

2025-02-16 13:20:53 -05:00
"""
Tests for both Catbox & Litterbox
"""
2025-02-16 13:16:53 -05:00
import os
import logging
import asyncio
from typing import Optional
2025-02-16 13:19:41 -05:00
from util.litterbox import LitterboxAsync
from util.catbox import CatboxAsync
2025-02-16 13:16:53 -05:00
logger = logging.getLogger()
logger.setLevel(logging.INFO)
2025-04-17 14:35:56 -04:00
2025-02-16 13:16:53 -05:00
async def test() -> None:
f = os.path.join(os.path.expanduser("~"), "qu.png")
box1: LitterboxAsync = LitterboxAsync()
box2: CatboxAsync = CatboxAsync()
url1: Optional[str] = await box1.upload(f)
url2: Optional[str] = await box2.upload(f)
2025-04-17 14:35:56 -04:00
logging.info(
"""Uploaded URLs:
2025-02-16 13:16:53 -05:00
Litter - %s\n
2025-04-17 14:35:56 -04:00
Cat - %s""",
url1,
url2,
)
asyncio.run(test())