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

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

Added python SimpleRunner GUI

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.