33from blockfrost import BlockFrostApi , ApiError
44from blockfrost .utils import convert_json_to_object
55
6- address = 'addr1qyptln5t5s0mastzc9rksn6wdqp9ynt67ahw0nhzukar5keu7yzv8ay6qvmlywtgvt7exaxt783dxuzv03qal7muda5sl42hg6 '
6+ address = 'addr1qxk49ptelk7uda7acrczz30a7fu778sax5aapa38nhmve3eu7yzv8ay6qvmlywtgvt7exaxt783dxuzv03qal7muda5srnx35s '
77stake_address = 'stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7'
88asset = 'f4988f549728dc76b58d7677849443caf6e5385dc67e6c25f6aa901e506978656c54696c653235'
99
@@ -32,7 +32,8 @@ def test_address(requests_mock):
3232
3333def test_integration_address ():
3434 if os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ):
35- api = BlockFrostApi (project_id = os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ))
35+ api = BlockFrostApi (project_id = os .getenv (
36+ 'BLOCKFROST_PROJECT_ID_MAINNET' ))
3637 assert api .address (address = address )
3738
3839
@@ -58,13 +59,16 @@ def test_address_extended(requests_mock):
5859 "type" : "shelley" ,
5960 "script" : False
6061 }
61- requests_mock .get (f"{ api .url } /addresses/{ address } /extended" , json = mock_data )
62- assert api .address_extended (address = address ) == convert_json_to_object (mock_data )
62+ requests_mock .get (
63+ f"{ api .url } /addresses/{ address } /extended" , json = mock_data )
64+ assert api .address_extended (
65+ address = address ) == convert_json_to_object (mock_data )
6366
6467
6568def test_integration_address_extended ():
6669 if os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ):
67- api = BlockFrostApi (project_id = os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ))
70+ api = BlockFrostApi (project_id = os .getenv (
71+ 'BLOCKFROST_PROJECT_ID_MAINNET' ))
6872 assert api .address_extended (address = address )
6973
7074
@@ -95,12 +99,14 @@ def test_address_total(requests_mock):
9599 "tx_count" : 12
96100 }
97101 requests_mock .get (f"{ api .url } /addresses/{ address } /total" , json = mock_data )
98- assert api .address_total (address = address ) == convert_json_to_object (mock_data )
102+ assert api .address_total (
103+ address = address ) == convert_json_to_object (mock_data )
99104
100105
101106def test_integration_address_total ():
102107 if os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ):
103- api = BlockFrostApi (project_id = os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ))
108+ api = BlockFrostApi (project_id = os .getenv (
109+ 'BLOCKFROST_PROJECT_ID_MAINNET' ))
104110 assert api .address_total (address = address )
105111
106112
@@ -152,13 +158,15 @@ def test_address_utxos(requests_mock):
152158 }
153159 ]
154160 requests_mock .get (f"{ api .url } /addresses/{ address } /utxos" , json = mock_data )
155- assert api .address_utxos (address = address ) == convert_json_to_object (mock_data )
161+ assert api .address_utxos (
162+ address = address ) == convert_json_to_object (mock_data )
156163
157164
158165def test_integration_address_utxos ():
159166 if os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ):
160- api = BlockFrostApi (project_id = os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ))
161- assert api .address_utxos (address = address )
167+ api = BlockFrostApi (project_id = os .getenv (
168+ 'BLOCKFROST_PROJECT_ID_MAINNET' ))
169+ assert api .address_utxos (address = address ) == []
162170
163171
164172def test_address_utxos_asset (requests_mock ):
@@ -205,13 +213,16 @@ def test_address_utxos_asset(requests_mock):
205213 "data_hash" : None
206214 }
207215 ]
208- requests_mock .get (f"{ api .url } /addresses/{ address } /utxos/{ asset } " , json = mock_data )
209- assert api .address_utxos_asset (address = address , asset = asset ) == convert_json_to_object (mock_data )
216+ requests_mock .get (
217+ f"{ api .url } /addresses/{ address } /utxos/{ asset } " , json = mock_data )
218+ assert api .address_utxos_asset (
219+ address = address , asset = asset ) == convert_json_to_object (mock_data )
210220
211221
212222def test_integration_address_utxos_asset ():
213223 if os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ):
214- api = BlockFrostApi (project_id = os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ))
224+ api = BlockFrostApi (project_id = os .getenv (
225+ 'BLOCKFROST_PROJECT_ID_MAINNET' ))
215226 assert api .address_utxos_asset (address = address , asset = asset ) == []
216227
217228
@@ -237,11 +248,14 @@ def test_address_transactions(requests_mock):
237248 "block_time" : 1834505492
238249 }
239250 ]
240- requests_mock .get (f"{ api .url } /addresses/{ address } /transactions" , json = mock_data )
241- assert api .address_transactions (address = address ) == convert_json_to_object (mock_data )
251+ requests_mock .get (
252+ f"{ api .url } /addresses/{ address } /transactions" , json = mock_data )
253+ assert api .address_transactions (
254+ address = address ) == convert_json_to_object (mock_data )
242255
243256
244257def test_integration_address_transactions ():
245258 if os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ):
246- api = BlockFrostApi (project_id = os .getenv ('BLOCKFROST_PROJECT_ID_MAINNET' ))
259+ api = BlockFrostApi (project_id = os .getenv (
260+ 'BLOCKFROST_PROJECT_ID_MAINNET' ))
247261 assert api .address_transactions (address = address )
0 commit comments