moar refactor
This commit is contained in:
		
							
								
								
									
										27
									
								
								tests/uploader_tests.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								tests/uploader_tests.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| #!/usr/bin/env python3.12 | ||||
|  | ||||
| """ | ||||
| Tests for both Catbox & Litterbox | ||||
| """ | ||||
|  | ||||
| import os | ||||
| import logging | ||||
| import asyncio | ||||
| from typing import Optional | ||||
| from util.litterbox import LitterboxAsync | ||||
| from util.catbox import CatboxAsync | ||||
|  | ||||
| logger = logging.getLogger() | ||||
| logger.setLevel(logging.INFO) | ||||
|  | ||||
| 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) | ||||
|     logging.info("""Uploaded URLs: | ||||
|           Litter - %s\n | ||||
|           Cat - %s""", url1, url2) | ||||
|      | ||||
| asyncio.run(test()) | ||||
		Reference in New Issue
	
	Block a user