Fixed unit tests
This commit is contained in:
8
tests.py
8
tests.py
@@ -47,7 +47,7 @@ class ConfigFileTestCase(unittest.TestCase):
|
|||||||
def test_interactive_mode(self, mock_user_input):
|
def test_interactive_mode(self, mock_user_input):
|
||||||
"""Check interactive mode."""
|
"""Check interactive mode."""
|
||||||
mock_user_input.side_effect = [
|
mock_user_input.side_effect = [
|
||||||
"0", "0", "", "", "", "", ""
|
"0", "0", "", "", "", "", "", ""
|
||||||
]
|
]
|
||||||
with open(os.devnull, "w") as fp:
|
with open(os.devnull, "w") as fp:
|
||||||
sys.stdout = fp
|
sys.stdout = fp
|
||||||
@@ -99,7 +99,7 @@ class ConfigFileTestCase(unittest.TestCase):
|
|||||||
def test_interactive_mode_letsencrypt(self, mock_user_input):
|
def test_interactive_mode_letsencrypt(self, mock_user_input):
|
||||||
"""Check interactive mode."""
|
"""Check interactive mode."""
|
||||||
mock_user_input.side_effect = [
|
mock_user_input.side_effect = [
|
||||||
"1", "admin@example.test", "0", "", "", "", ""
|
"0", "0", "1", "admin@example.test", "0", "", "", "", ""
|
||||||
]
|
]
|
||||||
with open(os.devnull, "w") as fp:
|
with open(os.devnull, "w") as fp:
|
||||||
sys.stdout = fp
|
sys.stdout = fp
|
||||||
@@ -126,8 +126,8 @@ class ConfigFileTestCase(unittest.TestCase):
|
|||||||
"example.test"])
|
"example.test"])
|
||||||
self.assertTrue(os.path.exists(self.cfgfile))
|
self.assertTrue(os.path.exists(self.cfgfile))
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"fail2ban modoboa automx rspamd clamav dovecot nginx razor "
|
"fail2ban modoboa automx amavis clamav dovecot nginx "
|
||||||
"postfix uwsgi radicale",
|
"postfix postwhite spamassassin uwsgi radicale opendkim",
|
||||||
out.getvalue()
|
out.getvalue()
|
||||||
)
|
)
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
|
|||||||
Reference in New Issue
Block a user