88def test_all_calls_correct_url_with_default_params ():
99 responses .add (
1010 responses .GET ,
11- 'http://127.0.0.1:4002/api/delegates ' ,
11+ 'http://127.0.0.1:4002/api/validators ' ,
1212 json = {'success' : True },
1313 status = 200
1414 )
1515
1616 client = ArkClient ('http://127.0.0.1:4002/api' )
17- client .delegates .all ()
17+ client .validators .all ()
1818 assert len (responses .calls ) == 1
19- assert responses .calls [0 ].request .url == 'http://127.0.0.1:4002/api/delegates ?limit=100'
19+ assert responses .calls [0 ].request .url == 'http://127.0.0.1:4002/api/validators ?limit=100'
2020
2121
2222def test_all_calls_correct_url_with_passed_in_params ():
2323 responses .add (
2424 responses .GET ,
25- 'http://127.0.0.1:4002/api/delegates ' ,
25+ 'http://127.0.0.1:4002/api/validators ' ,
2626 json = {'success' : True },
2727 status = 200
2828 )
2929
3030 client = ArkClient ('http://127.0.0.1:4002/api' )
31- client .delegates .all (page = 5 , limit = 69 )
31+ client .validators .all (page = 5 , limit = 69 )
3232 assert len (responses .calls ) == 1
33- assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/delegates ?' )
33+ assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/validators ?' )
3434 assert 'page=5' in responses .calls [0 ].request .url
3535 assert 'limit=69' in responses .calls [0 ].request .url
3636
3737
3838def test_all_calls_correct_url_with_additional_params ():
3939 responses .add (
4040 responses .GET ,
41- 'http://127.0.0.1:4002/api/delegates ' ,
41+ 'http://127.0.0.1:4002/api/validators ' ,
4242 json = {'success' : True },
4343 status = 200
4444 )
4545
4646 client = ArkClient ('http://127.0.0.1:4002/api' )
47- client .delegates .all (page = 5 , limit = 69 , orderBy = "username" )
47+ client .validators .all (page = 5 , limit = 69 , orderBy = "username" )
4848 assert len (responses .calls ) == 1
49- assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/delegates ?' )
49+ assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/validators ?' )
5050 assert 'page=5' in responses .calls [0 ].request .url
5151 assert 'limit=69' in responses .calls [0 ].request .url
5252 assert 'orderBy=username' in responses .calls [0 ].request .url
@@ -56,32 +56,32 @@ def test_get_calls_correct_url():
5656 delegate_id = '12345'
5757 responses .add (
5858 responses .GET ,
59- 'http://127.0.0.1:4002/api/delegates /{}' .format (delegate_id ),
59+ 'http://127.0.0.1:4002/api/validators /{}' .format (delegate_id ),
6060 json = {'success' : True },
6161 status = 200
6262 )
6363
6464 client = ArkClient ('http://127.0.0.1:4002/api' )
65- client .delegates .get (delegate_id )
65+ client .validators .get (delegate_id )
6666
6767 assert len (responses .calls ) == 1
68- assert responses .calls [0 ].request .url == 'http://127.0.0.1:4002/api/delegates /12345'
68+ assert responses .calls [0 ].request .url == 'http://127.0.0.1:4002/api/validators /12345'
6969
7070
7171def test_blocks_calls_correct_url ():
7272 delegate_id = '12345'
7373 responses .add (
7474 responses .GET ,
75- 'http://127.0.0.1:4002/api/delegates /{}/blocks' .format (delegate_id ),
75+ 'http://127.0.0.1:4002/api/validators /{}/blocks' .format (delegate_id ),
7676 json = {'success' : True },
7777 status = 200
7878 )
7979
8080 client = ArkClient ('http://127.0.0.1:4002/api' )
81- client .delegates .blocks (delegate_id , limit = 100 , orderBy = 'timestamp:desc' )
81+ client .validators .blocks (delegate_id , limit = 100 , orderBy = 'timestamp:desc' )
8282
8383 assert len (responses .calls ) == 1
84- assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/delegates /12345/blocks?' )
84+ assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/validators /12345/blocks?' )
8585 assert 'limit=100' in responses .calls [0 ].request .url
8686 assert 'orderBy=timestamp%3Adesc' in responses .calls [0 ].request .url
8787
@@ -90,15 +90,15 @@ def test_voters_calls_correct_url():
9090 delegate_id = '12345'
9191 responses .add (
9292 responses .GET ,
93- 'http://127.0.0.1:4002/api/delegates /{}/voters' .format (delegate_id ),
93+ 'http://127.0.0.1:4002/api/validators /{}/voters' .format (delegate_id ),
9494 json = {'success' : True },
9595 status = 200
9696 )
9797
9898 client = ArkClient ('http://127.0.0.1:4002/api' )
99- client .delegates .voters (delegate_id , limit = 100 , orderBy = 'timestamp:desc' )
99+ client .validators .voters (delegate_id , limit = 100 , orderBy = 'timestamp:desc' )
100100
101101 assert len (responses .calls ) == 1
102- assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/delegates /12345/voters?' )
102+ assert responses .calls [0 ].request .url .startswith ('http://127.0.0.1:4002/api/validators /12345/voters?' )
103103 assert 'limit=100' in responses .calls [0 ].request .url
104104 assert 'orderBy=timestamp%3Adesc' in responses .calls [0 ].request .url
0 commit comments