()
| 132 | |
| 133 | |
| 134 | def test_toggler(): |
| 135 | o = TO() |
| 136 | f = o.toggler("bool") |
| 137 | assert o.bool is False |
| 138 | f() |
| 139 | assert o.bool is True |
| 140 | f() |
| 141 | assert o.bool is False |
| 142 | with pytest.raises(Exception, match="No such option"): |
| 143 | o.toggler("nonexistent") |
| 144 | |
| 145 | with pytest.raises(Exception, match="boolean options"): |
| 146 | o.toggler("one") |
| 147 | |
| 148 | |
| 149 | class Rec: |