Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jpush-api-python-client
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
jpush-api-python-client
Commits
7b14ce3e
Commit
7b14ce3e
authored
Dec 02, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add devices API test cases;
parent
49e4df25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
test_devices.py
tests/devices/test_devices.py
+3
-0
test_entity.py
tests/devices/test_entity.py
+32
-0
No files found.
tests/devices/test_devices.py
0 → 100644
View file @
7b14ce3e
import
unittest
import
requests
import
jpush
tests/devices/test_entity.py
0 → 100644
View file @
7b14ce3e
import
unittest
import
jpush
class
TestEntity
(
unittest
.
TestCase
):
def
test_basic_entity
(
self
):
entities
=
(
(
jpush
.
add
,
'tag1'
,
{
'add'
:
[
'tag1'
]}),
(
jpush
.
remove
,
'tag1'
,
{
'remove'
:
[
'tag1'
]}),
(
jpush
.
device_tag
,
'tag1'
,
{
'tags'
:
'tag1'
}),
(
jpush
.
device_alias
,
'alias1'
,
{
'alias'
:
'alias1'
}),
(
jpush
.
device_regid
,
'registration_id1'
,
{
'registration_ids'
:
'registration_id1'
}),
)
for
entity
,
value
,
result
in
entities
:
self
.
assertEqual
(
entity
(
value
),
result
)
def
test_compound_entity
(
self
):
self
.
assertEqual
(
jpush
.
device_tag
(
jpush
.
add
(
"tag1"
,
"tag2"
)),
{
'tags'
:{
'add'
:[
'tag1'
,
'tag2'
]}})
self
.
assertEqual
(
jpush
.
device_tag
(
jpush
.
remove
(
"tag1"
,
"tag2"
)),
{
'tags'
:{
'remove'
:[
'tag1'
,
'tag2'
]}})
self
.
assertEqual
(
jpush
.
device_alias
(
jpush
.
add
(
"alias1"
,
"alias2"
),
jpush
.
remove
(
"alias3"
,
"alias4"
)),
{
'alias'
:{
'add'
:[
'alias1'
,
'alias2'
],
'remove'
:[
'alias3'
,
'alias4'
]}})
self
.
assertEqual
(
jpush
.
device_regid
(
jpush
.
add
(
"regid1"
,
"regid2"
),
jpush
.
remove
(
"regid3"
,
"regid4"
)),
{
'registration_ids'
:{
'add'
:[
'regid1'
,
'regid2'
],
'remove'
:[
'regid3'
,
'regid4'
]}})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment