mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 16:30:31 +02:00
Adding testing
This commit is contained in:
@@ -882,6 +882,15 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
mock_sys.exit.assert_called_with(''.join(
|
||||
traceback.format_exception_only(KeyboardInterrupt, interrupt)))
|
||||
|
||||
# Test dialog errors
|
||||
|
||||
import dialog
|
||||
exception = dialog.error(message="test message")
|
||||
main._handle_exception(
|
||||
dialog.DialogError, exc_value=exception, trace=None, config=None)
|
||||
error_msg = mock_sys.exit.call_args_list[-1][0][0]
|
||||
self.assertTrue("test message" in error_msg)
|
||||
|
||||
def test_read_file(self):
|
||||
rel_test_path = os.path.relpath(os.path.join(self.tmp_dir, 'foo'))
|
||||
self.assertRaises(
|
||||
|
||||
Reference in New Issue
Block a user