File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ exclude_paths :
3
+ - ' tests/**'
4
+ - ' *.md'
Original file line number Diff line number Diff line change
1
+ from client .resource import Resource
2
+
3
+
4
+ class Rounds (Resource ):
5
+
6
+ def delegates (self , round_id ):
7
+ return self .request_get ('rounds/{}/delegates' .format (round_id ))
Original file line number Diff line number Diff line change
1
+ import json
2
+
3
+ import responses
4
+
5
+ from client import ArkClient
6
+
7
+
8
+ def test_delegates_calls_correct_url ():
9
+ round_id = '12345'
10
+ responses .add (
11
+ responses .GET ,
12
+ 'http://127.0.0.1:4002/rounds/{}/delegates' .format (round_id ),
13
+ json = {'success' : True },
14
+ status = 200
15
+ )
16
+
17
+ client = ArkClient ('http://127.0.0.1:4002' )
18
+ client .rounds .delegates (round_id )
19
+
20
+ assert len (responses .calls ) == 1
21
+ assert responses .calls [0 ].request .url == 'http://127.0.0.1:4002/rounds/12345/delegates'
You can’t perform that action at this time.
0 commit comments