(self)
| 97 | self._check_conf(config) |
| 98 | |
| 99 | def test_context_manager(self): |
| 100 | fd, fname = mkstemp(".json", prefix="μnïcø∂e") |
| 101 | f = os.fdopen(fd, "w") |
| 102 | f.write("{}") |
| 103 | f.close() |
| 104 | |
| 105 | cl = JSONFileConfigLoader(fname, log=log) |
| 106 | |
| 107 | value = "context_manager" |
| 108 | |
| 109 | with cl as c: |
| 110 | c.MyAttr.value = value |
| 111 | |
| 112 | self.assertEqual(cl.config.MyAttr.value, value) |
| 113 | |
| 114 | # check that another loader does see the change |
| 115 | _ = JSONFileConfigLoader(fname, log=log) |
| 116 | self.assertEqual(cl.config.MyAttr.value, value) |
| 117 | |
| 118 | def test_json_context_bad_write(self): |
| 119 | fd, fname = mkstemp(".json", prefix="μnïcø∂e") |
nothing calls this directly
no test coverage detected