Skip to content

Commit 496546c

Browse files
committed
add unittest for setting module
1 parent 652512d commit 496546c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/plugin_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def test_setting():
1111
plugin = WechatyPlugin()
1212

1313
plugin.setting['unk'] = 11
14+
plugin.setting['count'] += 20
1415

1516
# load the setting file
1617
assert os.path.exists(plugin.setting_file)
@@ -19,3 +20,5 @@ def test_setting():
1920
data = json.load(f)
2021

2122
assert data['unk'] == 11
23+
assert data['count'] == 20
24+

tests/utils_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,7 @@ def change_value(key: str, _: int, data: HookDict):
5656
assert data['1'] == 11
5757

5858
data['1'] = 20
59-
assert data['1'] == 30
59+
assert data['1'] == 30
60+
61+
data['2'] += 10
62+
assert data['2'] == 20

0 commit comments

Comments
 (0)