@@ -14,28 +14,28 @@ class TestCallFlow(unittest.TestCase):
1414 def test_get_flow (self ):
1515 http_client = Mock ()
1616 http_client .request .return_value = '''{
17- "data": [
18- {
19- "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
20- "title": "Updated call flow",
21- "record": false,
22- "steps": [
23- {
24- "id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
25- "action": "transfer",
26- "options": {
27- "destination": "31611223344"
17+ "data": [
18+ {
19+ "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
20+ "title": "Updated call flow",
21+ "record": false,
22+ "steps": [
23+ {
24+ "id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
25+ "action": "transfer",
26+ "options": {
27+ "destination": "31611223344"
28+ }
29+ }
30+ ],
31+ "createdAt": "2017-03-06T13:34:14Z",
32+ "updatedAt": "2017-03-06T15:02:38Z"
33+ }
34+ ],
35+ "_links": {
36+ "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635"
2837 }
2938 }
30- ],
31- "createdAt": "2017-03-06T13:34:14Z",
32- "updatedAt": "2017-03-06T15:02:38Z"
33- }
34- ],
35- "_links": {
36- "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635"
37- }
38- }
3939 '''
4040
4141 call_flow = Client ('' , http_client ).call_flow ('de3ed163-d5fc-45f4-b8c4-7eea7458c635' )
@@ -47,56 +47,56 @@ def test_get_flow(self):
4747 def test_get_flow_list (self ):
4848 http_client = Mock ()
4949 http_client .request .return_value = '''{
50- "data": [
51- {
52- "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
53- "title": "Forward call to 31612345678",
54- "record": false,
55- "steps": [
56- {
57- "id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
58- "action": "transfer",
59- "options": {
60- "destination": "31612345678"
50+ "data": [
51+ {
52+ "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
53+ "title": "Forward call to 31612345678",
54+ "record": false,
55+ "steps": [
56+ {
57+ "id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
58+ "action": "transfer",
59+ "options": {
60+ "destination": "31612345678"
61+ }
62+ }
63+ ],
64+ "createdAt": "2017-03-06T13:34:14Z",
65+ "updatedAt": "2017-03-06T13:34:14Z",
66+ "_links": {
67+ "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635"
68+ }
69+ },
70+ {
71+ "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c634",
72+ "title": "Forward call to 0600123123",
73+ "record": true,
74+ "steps": [
75+ {
76+ "id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
77+ "action": "transfer",
78+ "options": {
79+ "destination": "31612345678"
80+ }
81+ }
82+ ],
83+ "createdAt": "2017-03-06T13:34:14Z",
84+ "updatedAt": "2017-03-06T13:34:14Z",
85+ "_links": {
86+ "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c634"
87+ }
88+ }
89+ ],
90+ "_links": {
91+ "self": "/call-flows?page=1"
92+ },
93+ "pagination": {
94+ "totalCount": 2,
95+ "pageCount": 2,
96+ "currentPage": 1,
97+ "perPage": 10
6198 }
6299 }
63- ],
64- "createdAt": "2017-03-06T13:34:14Z",
65- "updatedAt": "2017-03-06T13:34:14Z",
66- "_links": {
67- "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635"
68- }
69- },
70- {
71- "id": "de3ed163-d5fc-45f4-b8c4-7eea7458c634",
72- "title": "Forward call to 0600123123",
73- "record": true,
74- "steps": [
75- {
76- "id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
77- "action": "transfer",
78- "options": {
79- "destination": "31612345678"
80- }
81- }
82- ],
83- "createdAt": "2017-03-06T13:34:14Z",
84- "updatedAt": "2017-03-06T13:34:14Z",
85- "_links": {
86- "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c634"
87- }
88- }
89- ],
90- "_links": {
91- "self": "/call-flows?page=1"
92- },
93- "pagination": {
94- "totalCount": 2,
95- "pageCount": 2,
96- "currentPage": 1,
97- "perPage": 10
98- }
99- }
100100 '''
101101
102102 call_flow_list = Client ('' , http_client ).call_flow_list (20 , 0 )
@@ -109,33 +109,34 @@ def test_get_flow_list(self):
109109 def test_numbers_list (self ):
110110 http_client = Mock ()
111111 http_client .request .return_value = '''{
112- "data": [
113- {
114- "id": "13f38f34-7ff4-45b3-8783-8d5b1143f22b",
115- "number": "31611111111",
116- "callFlowId": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
117- "createdAt": "2017-03-16T13:49:24Z",
118- "updatedAt": "2017-09-12T08:59:50Z",
119- "_links": {
120- "self": "/numbers/13f38f34-7ff4-45b3-8783-8d5b1143f22b"
121- }
122- }
123- ],
124- "_links": {
125- "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635/numbers?page=1"
126- },
127- "pagination": {
128- "totalCount": 1,
129- "pageCount": 1,
130- "currentPage": 1,
131- "perPage": 10
132- }
133- }
112+ "data": [
113+ {
114+ "id": "13f38f34-7ff4-45b3-8783-8d5b1143f22b",
115+ "number": "31611111111",
116+ "callFlowId": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
117+ "createdAt": "2017-03-16T13:49:24Z",
118+ "updatedAt": "2017-09-12T08:59:50Z",
119+ "_links": {
120+ "self": "/numbers/13f38f34-7ff4-45b3-8783-8d5b1143f22b"
121+ }
122+ }
123+ ],
124+ "_links": {
125+ "self": "/call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635/numbers?page=1"
126+ },
127+ "pagination": {
128+ "totalCount": 1,
129+ "pageCount": 1,
130+ "currentPage": 1,
131+ "perPage": 10
132+ }
133+ }
134134 '''
135135
136136 number_list = Client ('' , http_client ).call_flow_numbers_list ('de3ed163-d5fc-45f4-b8c4-7eea7458c635' )
137137
138- http_client .request .assert_called_once_with ('call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635/numbers' , 'GET' , None )
138+ http_client .request .assert_called_once_with ('call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635/numbers' , 'GET' ,
139+ None )
139140
140141 self .assertEqual ('31611111111' , number_list .data [0 ].number )
141142 self .assertEqual (1 , number_list .pagination ['totalCount' ])
@@ -144,9 +145,12 @@ def test_numbers_add(self):
144145 http_client = Mock ()
145146 http_client .request .return_value = '{}'
146147
147- Client ('' , http_client ).call_flow_numbers_add ('de3ed163-d5fc-45f4-b8c4-7eea7458c635' ,
148- ['31611111111' , '31611111112' ])
148+ Client ('' , http_client ).call_flow_numbers_add (
149+ 'de3ed163-d5fc-45f4-b8c4-7eea7458c635' ,
150+ ['31611111111' , '31611111112' ]
151+ )
149152
150153 params = {'numbers' : ['31611111111' , '31611111112' ]}
151154
152- http_client .request .assert_called_once_with ('call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635/numbers' , 'POST' , params )
155+ http_client .request .assert_called_once_with (
156+ 'call-flows/de3ed163-d5fc-45f4-b8c4-7eea7458c635/numbers' , 'POST' , params )
0 commit comments