forked from leancloud/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_push.py
More file actions
33 lines (26 loc) · 698 Bytes
/
Copy pathtest_push.py
File metadata and controls
33 lines (26 loc) · 698 Bytes
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
27
28
29
30
31
32
33
# coding: utf-8
from nose.tools import with_setup
import leancloud
from leancloud import push
__author__ = 'asaka'
def setup_func():
leancloud.init(
'pgk9e8orv8l9coak1rjht1avt2f4o9kptb0au0by5vbk9upb',
'hi4jsm62kok2qz2w2qphzryo564rzsrucl2czb0hn6ogwwnd',
)
@with_setup(setup_func)
def test_basic_push():
data = {
"alert": {
"title": "标题",
"title-loc-key": "",
"body": "消息内容",
"action-loc-key": "",
"loc-key": "",
"loc-args": [""],
"launch-image": "",
}
}
notification = push.send(data)
notification.fetch()
print notification.attributes