extending test cases (increase coverage) + changelog entry for #1099

pull/1099/head
sebres 2015-07-06 22:04:25 +02:00
parent 3e47ce7f2a
commit 4a4fe7d76a
3 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,8 @@ ver. 0.9.3 (2015/XX/XXX) - wanna-be-released
- Added regex to work with 'userlogins' log
* action.d/sendmail*.conf - use LC_ALL (superseeding LC_TIME) to override
locale on systems with customized LC_ALL
* performance fix: minimizes connection overhead, close socket only at
communication end (gh-1099)
- New Features:
* New filters:

View File

@ -25,11 +25,13 @@ __copyright__ = "Copyright (c) 2013 Steven Hiscocks"
__license__ = "GPL"
import os
import sys
import tempfile
import threading
import time
import unittest
from .. import protocol
from ..server.asyncserver import AsyncServer, AsyncServerException
from ..client.csocket import CSocket
@ -88,3 +90,17 @@ class Socket(unittest.TestCase):
self.server.stop()
serverThread.join(1)
self.assertFalse(os.path.exists(self.sock_name))
class ClientMisc(unittest.TestCase):
def testPrintFormattedAndWiki(self):
# redirect stdout to devnull
saved_stdout = sys.stdout
sys.stdout = open(os.devnull, 'w')
try:
protocol.printFormatted()
protocol.printWiki()
finally:
# restore stdout
sys.stdout = saved_stdout

View File

@ -126,6 +126,7 @@ def gatherTests(regexps=None, no_network=False):
tests.addTest(unittest.makeSuite(clientreadertestcase.JailsReaderTestCache))
# CSocket and AsyncServer
tests.addTest(unittest.makeSuite(sockettestcase.Socket))
tests.addTest(unittest.makeSuite(sockettestcase.ClientMisc))
# Misc helpers
tests.addTest(unittest.makeSuite(misctestcase.HelpersTest))
tests.addTest(unittest.makeSuite(misctestcase.SetupTest))