(self)
| 39 | |
| 40 | |
| 41 | def test_simple_init(self): |
| 42 | setting_file = os.path.join(self.tempdir.name, 'simple_setting.json') |
| 43 | wechaty_setting: WechatySetting = WechatySetting(setting_file) |
| 44 | |
| 45 | assert os.path.exists(setting_file) |
| 46 | |
| 47 | wechaty_setting['a'] = 'a' |
| 48 | assert 'a' in wechaty_setting.read_setting() |
| 49 | assert wechaty_setting.read_setting()['a'] == 'a' |
| 50 | |
| 51 | assert 'b' not in wechaty_setting |
| 52 | |
| 53 | assert wechaty_setting.get("b", "b") == "b" |
| 54 | |
| 55 | wechaty_setting.save_setting({"c": "c"}) |
| 56 | assert 'a' not in wechaty_setting |
| 57 | assert 'c' in wechaty_setting |
| 58 | |
| 59 | def test_sub_setting(self): |
| 60 | setting_file = os.path.join(self.tempdir.name, "sub", 'simple_setting.json') |
nothing calls this directly
no test coverage detected