Cell Handler specifications

 

String cell handlers.

The blank and null keywords are a FitNesse extension, the asis[] cell handler is a Python FIT extension. Also note that the asis[] cell handler needs to be enabled specifically; see the fixture for details.

 

Two of the result cells use the Fail[] cell handler because the actual result contains either leading or trailing white space; the standard string type adapter cannot handle this comparison, so it reports a wrong

 

fit.AccTestFixtures.CellHandlerTestFixtures.StringCellHandlers
inputstring lengthoutputNotes
blank0blankblank is a keyword for a zero length string
null-1nullnull is a None object, -1 is a hack.
asis[]0blankAnother way of entering a zero length string
asis[ ]1 blank string
asis[ x ]3Fail[x]leading and trailing white space
asis[ [ x ] ]7Fail[[ x ]]embedded brackets
blank0asis[]some tests for asis checks.
asis[ ]1asis[ ] 
asis[ x ]3asis[ x ] 
asis[ [ x ] ]7asis[ [ x ] ] 
asis[ asis[ x ] ]11asis[ asis[ x ] ]recursion

Exception cell handler parameters

The exception cell handler is an extension of the error keyword. It allows the test writer to specify either the exception type or the exception message or both. This table shows the valid formats for the parameter.

fit.AccTestFixtures.CellHandlerTestFixtures.ParseExceptionCellHandler
contentstypemessage lengthmessagevalue lengthvalueNotes
snafusnafunullnullnullnullC
"fubar"null5fubarnullnullM
fubar: "snafu"fubar5snafunullnullC:M
snafu, "fubar"snafu5fubarnullnullC,M
snafu, "fubar", "oops"snafu5fubar4oopsC,M,V
snafu,,"oops"snafunullnull4oopsC,M,V
,"fubar"null5fubarnullnull,M,V
,,"oops"nullnullnull4oopsC,M,V

Exception Cell Handler for results without values

This is the exception cell handler from FitNesse dotNet and Python FIT 0.7. It performs a 'get' operation, but does not take the additional step of doing the comparison, because this form does not contain a value to compare against.

The first three lines use the old syntax, the next two use the new syntax. The last line uses the error keyword from the base FIT package.

fit.AccTestFixtures.CellHandlerTestFixtures.ExceptionCellHandler
typemessagegetNotes
Exceptionfubarexception[Exception]C
Exceptionfubarexception["fubar"]M
Exceptionfubarexception[Exception: "fubar"]C:M
Exceptionfubarexception[Exception, "fubar"]C,M
Exceptionfubarexception[, "fubar"],M
ExceptionfubarerrorFIT base

Exception Cell Handler for results with values

This version does both the get and the equals routine against a calculated result. It's new in Python FIT 0.8

fit.AccTestFixtures.CellHandlerTestFixtures.ExceptionCellHandler
typemessagevaluecheckNotes
Exceptionfubaroops!exception[Exception,,"huh?"]C,,V
Exceptionfubaroops!exception["fubar", "huh?"]M,V
Exceptionfubaroops!exception[Exception, "fubar", "huh?"]C,M,V
Exceptionfubaroops!Fail[exception["snafu", "huh?"]]M,V
Exceptionfubaroops!Fail[exception[Exception, "snafu", "huh?"]]C,M,V

Exception Cell Handler for given values

The exception cell handler for a given value must include the value parameter. It can also be enclosed in a Fail cell handler; this is the only time the Fail cell handler is legal in a given cell

fit.AccTestFixtures.CellHandlerTestFixtures.ExceptionCellHandler
typemessagevaluestoreNotes
Exceptionfubaroops!exception[Exception,,"huh?"]C,,V
Exceptionfubaroops!exception["fubar", "huh?"]M,V
Exceptionfubaroops!exception[Exception, "fubar", "huh?"]C,M,V
Exceptionfubaroops!Fail[exception["snafu", "huh?"]]M,V
Exceptionfubaroops!Fail[exception[Exception, "snafu", "huh?"]]C,M,V