mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-14 04:11:51 -05:00
Hemna
e13ca0061a
This patch is the initial conversion of the custom config and config file yaml format to oslo_config's configuration mechanism. The resulting config format is now an ini type file. The default location is ~/.config/aprsd/aprsd.conf This is a backwards incompatible change. You will have to rebuild the config file and edit it. Also any aprsd plugins can now define config options in code and add an setup.cfg entry_point definition oslo_config.opts = foo.conf = foo.conf:list_opts
23 lines
558 B
Python
23 lines
558 B
Python
import sys
|
|
import unittest
|
|
|
|
from aprsd.plugins import email
|
|
|
|
|
|
if sys.version_info >= (3, 2):
|
|
from unittest import mock
|
|
else:
|
|
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)
|