MCPcopy
hub / github.com/wechaty/python-wechaty / test_sub_setting

Method test_sub_setting

tests/plugin_test.py:59–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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')
61 wechaty_setting: WechatySetting = WechatySetting(setting_file)
62
63 assert os.path.exists(setting_file)
64
65 wechaty_setting['a'] = 'a'
66 assert 'a' in wechaty_setting.read_setting()
67 assert wechaty_setting.read_setting()['a'] == 'a'
68
69 assert 'b' not in wechaty_setting
70
71 assert wechaty_setting.get("b", "b") == "b"
72
73 wechaty_setting.save_setting({"c": "c"})
74 assert 'a' not in wechaty_setting
75 assert 'c' in wechaty_setting
76
77
78 async def test_finder(self):

Callers

nothing calls this directly

Calls 4

read_settingMethod · 0.95
save_settingMethod · 0.95
WechatySettingClass · 0.90
getMethod · 0.80

Tested by

no test coverage detected