source: geniuswebcore/test/geniusweb/protocol/ProtocolExceptionTest.py@ 94

Last change on this file since 94 was 90, checked in by Bart Vastenhouw, 3 years ago

Refactor to help reusing partiesserver.

File size: 637 bytes
Line 
1import traceback
2import unittest
3
4from geniusweb.actions.PartyId import PartyId
5from geniusweb.protocol.ProtocolException import ProtocolException
6
7
8class ProtocolExceptionTest(unittest.TestCase):
9 def testConstructor(self):
10 party = PartyId("test")
11 try:
12 x=1/0
13 except Exception as e:
14 err = ProtocolException("div by zero", party, e)
15
16 print(err) # BUG ? FEATURE? this does NOT show the cause nor the stacktrace...
17 self.assertTrue(err)
18 self.assertTrue(err.__cause__)
19
20 def testNullParty(self):
21 ProtocolException("test",None, None)
22
Note: See TracBrowser for help on using the repository browser.