Spaces:
Running
Running
Download tests/email_parser_test.py from Leon4gr45/openoperator: direct link, hf CLI and curl.
- Browser
- Download file 856 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/tests/email_parser_test.py
- Command line
-
hf download hf://spaces/Leon4gr45/openoperator/tests/email_parser_test.py
-
curl -L -o email_parser_test.py https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/tests/email_parser_test.py
856 Bytes
| import sys, os | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| import asyncio | |
| import pytest | |
| from helpers.email_client import read_messages | |
| from helpers.dotenv import get_dotenv_value, load_dotenv | |
| async def test(): | |
| load_dotenv() | |
| messages = await read_messages( | |
| account_type=get_dotenv_value("TEST_SERVER_TYPE", "imap"), | |
| server=get_dotenv_value("TEST_EMAIL_SERVER"), | |
| port=int(get_dotenv_value("TEST_EMAIL_PORT", 993)), | |
| username=get_dotenv_value("TEST_EMAIL_USERNAME"), | |
| password=get_dotenv_value("TEST_EMAIL_PASSWORD"), | |
| ) | |
| print(messages) | |
| if __name__ == "__main__": | |
| asyncio.run(test()) | |