Пример #1
0
 def test_InConnection_5(self):
     _inheritance = {
         'base': [],
         'second': ['base'],
         'otherbase': [],
         'first': ['otherbase']
     }
     _catch = 'base'
     _above = 'otherbase'
     _Expected = False
     _Actual = Exceptions.InConnection(_catch, _above, _inheritance)
     self.assertEqual(_Actual, _Expected)
Пример #2
0
 def test_InConnection_6(self):
     _inheritance = {
         'BaseException': [],
         'Exception': ['BaseException'],
         'LookupError': ['Exception'],
         'KeyError': ['LookupError'],
     }
     _catch = 'KeyError'
     _above = 'BaseException'
     _Expected = True
     _Actual = Exceptions.InConnection(_catch, _above, _inheritance)
     self.assertEqual(_Actual, _Expected)
Пример #3
0
 def test_InConnection_2(self):
     _inheritance = {
         'ArithmeticError': [],
         'ZeroDivisionError': ['ArithmeticError']
     }
     # "next line only as info"
     _catches = ['ArithmeticError', 'ZeroDivisionError']
     _catch = 'ZeroDivisionError'
     _above = 'ArithmeticError'
     _Expected = True
     _Actual = Exceptions.InConnection(_catch, _above, _inheritance)
     self.assertEqual(_Actual, _Expected)