File tree Expand file tree Collapse file tree 4 files changed +591
-0
lines changed
Expand file tree Collapse file tree 4 files changed +591
-0
lines changed Original file line number Diff line number Diff line change 1+ from picketapi import exceptions
2+
3+
4+ def test_picket_api_exception ():
5+ assert exceptions .PicketAPIException is not None
6+
7+
8+ def test_picket_api_exception_init ():
9+ msg = "msg"
10+ code = "code"
11+ exception = exceptions .PicketAPIException (msg , code )
12+ assert exception .msg == msg
13+ assert exception .code == code
14+
15+
16+ def test_picket_api_exception_str ():
17+ msg = "msg"
18+ code = "code"
19+ exception = exceptions .PicketAPIException (msg , code )
20+ assert str (exception ) == msg
Original file line number Diff line number Diff line change 1+ from picketapi import helpers
2+
3+
4+ def test_is_successful_status_code_true ():
5+ assert helpers .is_successful_status_code (201 ) is True
6+
7+
8+ def test_is_successful_status_code_false ():
9+ assert helpers .is_successful_status_code (400 ) is False
10+
11+
12+ def test_snake_to_camel ():
13+ assert helpers .snake_to_camel ("snake_to_camel" ) == "snakeToCamel"
14+ assert helpers .snake_to_camel ("wallet_address" ) == "walletAddress"
15+ assert helpers .snake_to_camel ("contract_address" ) == "contractAddress"
16+ assert helpers .snake_to_camel ("token_ids" ) == "tokenIds"
17+
18+
19+ def test_snake_to_camel_keys ():
20+ d = {"snake_to_camel" : "snake_to_camel" , "wallet_address" : "wallet_address" }
21+ assert helpers .snake_to_camel_keys (d ) == {
22+ "snakeToCamel" : "snake_to_camel" ,
23+ "walletAddress" : "wallet_address" ,
24+ }
You can’t perform that action at this time.
0 commit comments