1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-16 05:12:01 -05:00
aprsd/tests/test_main.py

23 lines
558 B
Python
Raw Normal View History

import sys
import unittest
from aprsd.plugins import email
if sys.version_info >= (3, 2):
from unittest import mock
else:
2021-01-08 15:47:30 -05:00
from unittest import mock
class TestMain(unittest.TestCase):
@mock.patch("aprsd.plugins.email._imap_connect")
@mock.patch("aprsd.plugins.email._smtp_connect")
def test_validate_email(self, imap_mock, smtp_mock):
"""Test to make sure we fail."""
imap_mock.return_value = None
smtp_mock.return_value = {"smaiof": "fire"}
mock.MagicMock()
email.validate_email_config(True)