1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-06-17 13:52:49 -04:00
aprsd/tests/test_main.py
Hemna 08c73a17d1 Major refactor
This branch refactors the majority of main.py out into individual
modules to compartmentalize the code.  Migrated all email related
features unti email.py, sending of messages into messaging.py

Also refactored all of the socket code to use aprslib for all APRS-IS
communication as well as message/packet processing.

Moved the email command into it's own Plugin.
2020-12-18 16:21:35 -05:00

24 lines
522 B
Python

# -*- coding: utf-8 -*-
import sys
import unittest
import pytest
from aprsd import email
if sys.version_info >= (3, 2):
from unittest import mock
else:
import mock
class testMain(unittest.TestCase):
@mock.patch("aprsd.email._imap_connect")
@mock.patch("aprsd.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"}
email.validate_email()