2020-12-09 14:13:35 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import sys
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2020-12-17 10:00:47 -05:00
|
|
|
from aprsd import email
|
2020-12-09 14:13:35 -05:00
|
|
|
|
|
|
|
if sys.version_info >= (3, 2):
|
|
|
|
from unittest import mock
|
|
|
|
else:
|
|
|
|
import mock
|
|
|
|
|
|
|
|
|
|
|
|
class testMain(unittest.TestCase):
|
2020-12-17 10:00:47 -05:00
|
|
|
@mock.patch("aprsd.email._imap_connect")
|
|
|
|
@mock.patch("aprsd.email._smtp_connect")
|
2020-12-09 14:13:35 -05:00
|
|
|
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"}
|
|
|
|
|
2020-12-17 10:00:47 -05:00
|
|
|
email.validate_email()
|