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

Method test_simple_init

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

Source from the content-addressed store, hash-verified

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')

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