From bfe154d672897273559615c4b764eb8d92b1adfd Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Tue, 13 Jun 2023 21:12:46 -0400 Subject: [PATCH] Move tests to tests folder --- Makefile | 2 +- tests/__init__.py | 0 mail4one/config_test.py => tests/test_config.py | 2 +- mail4one/pop_test.py => tests/test_pop.py | 4 ++-- mail4one/pwhash_test.py => tests/test_pwhash.py | 2 +- mail4one/smtp_test.py => tests/test_smtp.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 tests/__init__.py rename mail4one/config_test.py => tests/test_config.py (98%) rename mail4one/pop_test.py => tests/test_pop.py (98%) rename mail4one/pwhash_test.py => tests/test_pwhash.py (93%) rename mail4one/smtp_test.py => tests/test_smtp.py (97%) diff --git a/Makefile b/Makefile index 4f7fb85..c9fe2f9 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ shell: MYPYPATH=`pipenv --venv`/lib/python3.11/site-packages pipenv shell test: - pipenv run python -m unittest mail4one/*test.py + pipenv run python -m unittest discover build: clean pipenv run python -m pip install -r <(pipenv requirements ) --target build diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mail4one/config_test.py b/tests/test_config.py similarity index 98% rename from mail4one/config_test.py rename to tests/test_config.py index aa64bf4..c9deb4a 100644 --- a/mail4one/config_test.py +++ b/tests/test_config.py @@ -1,6 +1,6 @@ import unittest -from . import config +from mail4one import config TEST_CONFIG = """ { diff --git a/mail4one/pop_test.py b/tests/test_pop.py similarity index 98% rename from mail4one/pop_test.py rename to tests/test_pop.py index e797725..9b2025f 100644 --- a/mail4one/pop_test.py +++ b/tests/test_pop.py @@ -4,8 +4,8 @@ import logging import tempfile import time import os -from .pop3 import create_pop_server -from .config import User +from mail4one.pop3 import create_pop_server +from mail4one.config import User from pathlib import Path TEST_HASH = "".join(c for c in """ diff --git a/mail4one/pwhash_test.py b/tests/test_pwhash.py similarity index 93% rename from mail4one/pwhash_test.py rename to tests/test_pwhash.py index f882954..8378494 100644 --- a/mail4one/pwhash_test.py +++ b/tests/test_pwhash.py @@ -1,4 +1,4 @@ -from .pwhash import gen_pwhash, parse_hash, check_pass, SALT_LEN, KEY_LEN +from mail4one.pwhash import gen_pwhash, parse_hash, check_pass, SALT_LEN, KEY_LEN import unittest diff --git a/mail4one/smtp_test.py b/tests/test_smtp.py similarity index 97% rename from mail4one/smtp_test.py rename to tests/test_smtp.py index 55491dd..1b5e087 100644 --- a/mail4one/smtp_test.py +++ b/tests/test_smtp.py @@ -7,7 +7,7 @@ import os from pathlib import Path -from .smtp import create_smtp_server +from mail4one.smtp import create_smtp_server TEST_MBOX = 'foobar_mails' MAILS_PATH: Path