Exemplo n.º 1
0
 def shouldHandleStringFromApplicationExit(self):
     self._setAppConfig((ExceptionTestAppConfig, ExceptionTestAppConfig(),
                         ExceptionTestAppConfig, ExceptionTestAppConfig()))
     e = FitException("Test003")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "It's magic!"
     assert isExc == KindOfMessage("exception")
     assert doTrace == TraceWanted("trace")
Exemplo n.º 2
0
 def shouldHandleTraceOverrideFromApplicationExit(self):
     self._setAppConfig((ExceptionTestAppConfig, ExceptionTestAppConfig(),
                         ExceptionTestAppConfig, ExceptionTestAppConfig()))
     e = FitException("Test001", "snark", "bojum")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "For the snark was a bojum, you see."
     assert isExc == KindOfMessage("wrong")
     assert doTrace == TraceWanted("ignore")
Exemplo n.º 3
0
 def shouldHandleNewMessageAndTraceFromApplicationExit(self):
     self._setAppConfig((ExceptionTestAppConfig, ExceptionTestAppConfig(),
                         ExceptionTestAppConfig, ExceptionTestAppConfig()))
     e = FitException("Test002")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "Insert lightbulb joke here"
     assert isExc == KindOfMessage("exception")
     assert doTrace == TraceWanted("ignore")
Exemplo n.º 4
0
 def shouldHandleStringFromApplicationExit(self):
     self._setAppConfig(
         (ExceptionTestAppConfig, ExceptionTestAppConfig(), ExceptionTestAppConfig, ExceptionTestAppConfig())
     )
     e = FitException("Test003")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "It's magic!"
     assert isExc == KindOfMessage("exception")
     assert doTrace == TraceWanted("trace")
Exemplo n.º 5
0
 def shouldHandleNewMessageAndTraceFromApplicationExit(self):
     self._setAppConfig(
         (ExceptionTestAppConfig, ExceptionTestAppConfig(), ExceptionTestAppConfig, ExceptionTestAppConfig())
     )
     e = FitException("Test002")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "Insert lightbulb joke here"
     assert isExc == KindOfMessage("exception")
     assert doTrace == TraceWanted("ignore")
Exemplo n.º 6
0
 def shouldHandleTraceOverrideFromApplicationExit(self):
     self._setAppConfig(
         (ExceptionTestAppConfig, ExceptionTestAppConfig(), ExceptionTestAppConfig, ExceptionTestAppConfig())
     )
     e = FitException("Test001", "snark", "bojum")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "For the snark was a bojum, you see."
     assert isExc == KindOfMessage("wrong")
     assert doTrace == TraceWanted("ignore")
Exemplo n.º 7
0
 def should_badKey(self):
     e = FitException("100tseT", "snark", "bojum")
     result = e.getMeaningfulMessage()
     assert result[
         2] == "Unknown Message Key: ('100tseT', 'snark', 'bojum')"
Exemplo n.º 8
0
 def shouldRetrieveMessageParameters(self):
     e = FitException("Test001", "snark", "bojum")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "For the snark was a bojum, you see."
     assert isExc == KindOfMessage("wrong")
     assert doTrace == TraceWanted("notrace")
Exemplo n.º 9
0
    def args(self, aTuple):
#        em("\nargs: '%s'" % (aTuple,))
        excObj = FitException(*aTuple)
#        em("argsInFitException: '%s'" % (excObj.args,))
        self.exc, self.trace, self.message = excObj.getMeaningfulMessage()
Exemplo n.º 10
0
 def should_badKey(self):
     e = FitException("100tseT", "snark", "bojum")
     result = e.getMeaningfulMessage()
     assert result[2] == "Unknown Message Key: ('100tseT', 'snark', 'bojum')"
Exemplo n.º 11
0
 def shouldRetrieveMessageParameters(self):
     e = FitException("Test001", "snark", "bojum")
     isExc, doTrace, msg = e.getMeaningfulMessage()
     assert msg == "For the snark was a bojum, you see."
     assert isExc == KindOfMessage("wrong")
     assert doTrace == TraceWanted("notrace")