- Notifications
You must be signed in to change notification settings - Fork 415
/
Copy pathtest_webhook.py
26 lines (23 loc) · 702 Bytes
/
test_webhook.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
importos
importjson
fromapp.utils.HookDataParseimport (
get_repo_name,
get_repo_branch,
get_push_name,
get_push_email
)
WEBHOOKDATA_DIR=os.path.join(os.path.dirname(__file__), 'webhookdata')
WEBHOOKDATA= {}
forfilenameinos.listdir(WEBHOOKDATA_DIR):
name=os.path.splitext(filename)[0]
withopen(os.path.join(WEBHOOKDATA_DIR, filename)) asf:
data=json.load(f)
WEBHOOKDATA[name] =data
deftest():
forname, datainWEBHOOKDATA.items():
print('\n'+name.center(60, '-'))
print(get_repo_name(data))
print(get_repo_branch(data))
print(get_push_name(data))
print(get_push_email(data))