Coverage for ejpiaj/assertions: 79%

# Coverage for ejpiaj/assertions : 79%

## 19 statements 15 run 4 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | from .decorators import assertion @assertion('equals') def equals_assertion(value, params): return str(value) == str(params) @assertion('notequals') def notequals_assertion(value, params): return not equals_assertion(value, params) @assertion('in') def in_assertion(value, params): return str(value) in params.split(',') @assertion('notin') def notin_assertion(value, params): return not in_assertion(value, params) @assertion('empty') def empty_assertion(value): if value is None: return True return not str(value) @assertion('notempty') def notempty_assertion(value): return not empty_assertion(value) @assertion('contains') def contains_assertion(value, params): return str(params) in str(value) @assertion('notcontains') def notcontains_assertion(value, params): return not contains_assertion(value, params)