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

Function test_setting

tests/plugin_test.py:12–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_setting():
13 with tempfile.TemporaryDirectory() as cache_dir:
14 os.environ['CACHE_DIR'] = cache_dir
15 plugin = WechatyPlugin()
16
17 plugin.setting['unk'] = 11
18
19 assert 'count' not in plugin.setting
20 plugin.setting['count'] = 20
21
22 # load the setting file
23 assert os.path.exists(plugin.setting_file)
24
25 with open(plugin.setting_file, 'r', encoding='utf-8') as f:
26 data = json.load(f)
27
28 assert data['unk'] == 11
29 assert data['count'] == 20
30
31
32class TestWechatySetting(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

WechatyPluginClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected