Use addprotocol to that the protocol tests can pass options at instanciation

This commit is contained in:
Christophe de Vienne 2011-10-18 16:56:25 +02:00
parent c4605c4516
commit 08ffc0f71c

View File

@ -217,9 +217,12 @@ class WSTestRoot(WSRoot):
class ProtocolTestCase(unittest.TestCase):
protocol_options = {}
def setUp(self):
if self.__class__.__name__ != 'ProtocolTestCase':
self.root = WSTestRoot([self.protocol])
self.root = WSTestRoot()
self.root.addprotocol(self.protocol, **self.protocol_options)
self.app = TestApp(wsme.wsgi.adapt(self.root))