(tmpdir)
| 127 | |
| 128 | |
| 129 | def test_options(tmpdir): |
| 130 | p = str(tmpdir.join("path")) |
| 131 | sa = core.Core() |
| 132 | with taddons.context() as tctx: |
| 133 | tctx.options.listen_host = "foo" |
| 134 | assert tctx.options.listen_host == "foo" |
| 135 | sa.options_reset_one("listen_host") |
| 136 | assert tctx.options.listen_host != "foo" |
| 137 | |
| 138 | with pytest.raises(exceptions.CommandError): |
| 139 | sa.options_reset_one("unknown") |
| 140 | |
| 141 | tctx.options.listen_host = "foo" |
| 142 | sa.options_save(p) |
| 143 | with pytest.raises(exceptions.CommandError): |
| 144 | sa.options_save("/") |
| 145 | |
| 146 | sa.options_reset() |
| 147 | assert tctx.options.listen_host == "" |
| 148 | sa.options_load(p) |
| 149 | assert tctx.options.listen_host == "foo" |
| 150 | |
| 151 | sa.options_load("/nonexistent") |
| 152 | |
| 153 | with open(p, "a") as f: |
| 154 | f.write("'''") |
| 155 | with pytest.raises(exceptions.CommandError): |
| 156 | sa.options_load(p) |
| 157 | |
| 158 | |
| 159 | def test_validation_simple(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…