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 | |||
input | string length | output | Notes |
blank | 0 | blank | blank is a keyword for a zero length string |
null | -1 | null | null is a None object, -1 is a hack. |
asis[] | 0 | blank | Another way of entering a zero length string |
asis[ ] | 1 | blank string | |
asis[ x ] | 3 | Fail[x] | leading and trailing white space |
asis[ [ x ] ] | 7 | Fail[[ x ]] | embedded brackets |
blank | 0 | asis[] | some tests for asis checks. |
asis[ ] | 1 | asis[ ] | |
asis[ x ] | 3 | asis[ x ] | |
asis[ [ x ] ] | 7 | asis[ [ x ] ] | |
asis[ asis[ x ] ] | 11 | asis[ asis[ x ] ] | recursion |
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 | ||||||
contents | type | message length | message | value length | value | Notes |
snafu | snafu | null | null | null | null | C |
"fubar" | null | 5 | fubar | null | null | M |
fubar: "snafu" | fubar | 5 | snafu | null | null | C:M |
snafu, "fubar" | snafu | 5 | fubar | null | null | C,M |
snafu, "fubar", "oops" | snafu | 5 | fubar | 4 | oops | C,M,V |
snafu,,"oops" | snafu | null | null | 4 | oops | C,M,V |
,"fubar" | null | 5 | fubar | null | null | ,M,V |
,,"oops" | null | null | null | 4 | oops | C,M,V |
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 | |||
type | message | get | Notes |
Exception | fubar | exception[Exception] | C |
Exception | fubar | exception["fubar"] | M |
Exception | fubar | exception[Exception: "fubar"] | C:M |
Exception | fubar | exception[Exception, "fubar"] | C,M |
Exception | fubar | exception[, "fubar"] | ,M |
Exception | fubar | error | FIT base |
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 | ||||
type | message | value | check | Notes |
Exception | fubar | oops! | exception[Exception,,"huh?"] | C,,V |
Exception | fubar | oops! | exception["fubar", "huh?"] | M,V |
Exception | fubar | oops! | exception[Exception, "fubar", "huh?"] | C,M,V |
Exception | fubar | oops! | Fail[exception["snafu", "huh?"]] | M,V |
Exception | fubar | oops! | Fail[exception[Exception, "snafu", "huh?"]] | C,M,V |
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 | ||||
type | message | value | store | Notes |
Exception | fubar | oops! | exception[Exception,,"huh?"] | C,,V |
Exception | fubar | oops! | exception["fubar", "huh?"] | M,V |
Exception | fubar | oops! | exception[Exception, "fubar", "huh?"] | C,M,V |
Exception | fubar | oops! | Fail[exception["snafu", "huh?"]] | M,V |
Exception | fubar | oops! | Fail[exception[Exception, "snafu", "huh?"]] | C,M,V |