diff --git a/.gitignore b/.gitignore index 62416fa..6205f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ .venv/ -.secrets/ \ No newline at end of file +.secrets/ +__pycache__/ \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 9c9919f..ca7bcad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ certbot==5.4.0 certbot-dns-cloudflare==5.4.0 -pydantic==2.12.5 \ No newline at end of file +pydantic==2.12.5 +email-validator==2.3.0 \ No newline at end of file diff --git a/test_schemas.py b/test_schemas.py new file mode 100644 index 0000000..2ad0ce9 --- /dev/null +++ b/test_schemas.py @@ -0,0 +1,18 @@ +test_domain_request = { + 'domain': 'example.com', + 'credentials_file': '.secrets.example/certbot/cloudflare.ini', + 'email': 'admin@example.com' +} + +if __name__ == '__main__': + from schemas import DomainRequest + from pydantic import ValidationError + + try: + domain_request = DomainRequest(**test_domain_request) + print("DomainRequest validation successful:", domain_request) + except ValidationError as e: + print("DomainRequest validation failed:", e) + except Exception as e: + print("An unexpected error occurred:", e) + raise e \ No newline at end of file