From ae50914abd849e250565a98f62cd44de795cb295 Mon Sep 17 00:00:00 2001 From: SAIKAT KARMAKAR Date: Sat, 6 Jan 2024 12:04:52 +0530 Subject: [PATCH] minor test fails fixed --- src/bee_py/modules/bytes.py | 6 +++--- src/bee_py/modules/bzz.py | 8 ++++---- src/bee_py/modules/chunk.py | 4 ++-- src/bee_py/modules/debug/chequebook.py | 17 ++++++++--------- src/bee_py/modules/debug/connectivity.py | 10 +++++----- src/bee_py/modules/debug/stake.py | 4 ++-- src/bee_py/modules/debug/stamps.py | 14 +++++++------- src/bee_py/modules/debug/states.py | 7 +++---- src/bee_py/modules/debug/status.py | 6 +++--- src/bee_py/modules/debug/tag.py | 2 +- src/bee_py/modules/debug/transactions.py | 8 ++++---- src/bee_py/modules/pinning.py | 8 ++++---- src/bee_py/modules/pss.py | 2 +- src/bee_py/modules/soc.py | 2 +- src/bee_py/modules/stewardship.py | 4 ++-- src/bee_py/modules/tag.py | 10 +++++----- 16 files changed, 55 insertions(+), 57 deletions(-) diff --git a/src/bee_py/modules/bytes.py b/src/bee_py/modules/bytes.py index b20cc17..7082a4a 100644 --- a/src/bee_py/modules/bytes.py +++ b/src/bee_py/modules/bytes.py @@ -43,7 +43,7 @@ def upload( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore upload_response = response.json() reference = Reference(value=upload_response["reference"]) @@ -75,7 +75,7 @@ def download(request_options: BeeRequestOptions, _hash: ReferenceOrENS) -> Data: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return wrap_bytes_with_helpers(response.content) @@ -99,7 +99,7 @@ def download_readable(request_options: BeeRequestOptions, _hash: ReferenceOrENS) logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return response diff --git a/src/bee_py/modules/bzz.py b/src/bee_py/modules/bzz.py index bbdf988..02dc39d 100644 --- a/src/bee_py/modules/bzz.py +++ b/src/bee_py/modules/bzz.py @@ -80,7 +80,7 @@ def upload_file( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore upload_response = response.json() reference = Reference(value=upload_response["reference"]) @@ -117,7 +117,7 @@ def download_file(request_options: BeeRequestOptions, _hash: ReferenceOrENS, pat logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore file_headers = read_file_headers(response.headers) file_data = wrap_bytes_with_helpers(response.content) @@ -146,7 +146,7 @@ def download_file_readable(request_options: BeeRequestOptions, _hash: ReferenceO logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore file_headers = read_file_headers(response.headers) file_data = response.data @@ -226,7 +226,7 @@ def upload_collection( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore upload_response = response.json() reference = Reference(value=upload_response["reference"]) diff --git a/src/bee_py/modules/chunk.py b/src/bee_py/modules/chunk.py index 252acd8..d93f967 100644 --- a/src/bee_py/modules/chunk.py +++ b/src/bee_py/modules/chunk.py @@ -39,7 +39,7 @@ def upload( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return Reference(value=response.json()["reference"]) @@ -56,5 +56,5 @@ def download(request_options: BeeRequestOptions, _hash: ReferenceOrENS) -> Data: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return wrap_bytes_with_helpers(response.content) diff --git a/src/bee_py/modules/debug/chequebook.py b/src/bee_py/modules/debug/chequebook.py index 69c3363..2767036 100644 --- a/src/bee_py/modules/debug/chequebook.py +++ b/src/bee_py/modules/debug/chequebook.py @@ -37,7 +37,7 @@ def get_chequebook_address( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore chequebook_address_response = response.json() return ChequebookAddressResponse.model_validate(chequebook_address_response) @@ -64,7 +64,7 @@ def get_chequebook_balance( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore chequebook_balance_response = response.json() return ChequebookBalanceResponse.model_validate(chequebook_balance_response) @@ -93,8 +93,7 @@ def get_last_cashout_action( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore - return None # type: ignore + return None # type: ignore last_cashout_action_response = response.json() return LastCashoutActionResponse.model_validate(last_cashout_action_response) @@ -140,7 +139,7 @@ def cashout_last_cheque( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore transaction_response = response.json() return transaction_response["transactionHash"] @@ -169,7 +168,7 @@ def get_last_cheques_for_peer( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore last_cheques_for_peer_response = response.json() return LastChequesForPeerResponse.model_validate(last_cheques_for_peer_response) @@ -194,7 +193,7 @@ def get_last_cheques(request_options: BeeRequestOptions) -> LastChequesResponse: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore last_cheques_response = response.json() return LastChequesResponse.model_validate(last_cheques_response) @@ -235,7 +234,7 @@ def deposit_tokens( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore transaction_response = response.json() return transaction_response["transactionHash"] @@ -276,7 +275,7 @@ def withdraw_tokens( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore transaction_response = response.json() return transaction_response["transactionHash"] diff --git a/src/bee_py/modules/debug/connectivity.py b/src/bee_py/modules/debug/connectivity.py index d771aab..d332a64 100644 --- a/src/bee_py/modules/debug/connectivity.py +++ b/src/bee_py/modules/debug/connectivity.py @@ -28,7 +28,7 @@ def get_node_addresses(request_options: BeeRequestOptions) -> NodeAddresses: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore addresses_response = response.json() return NodeAddresses.model_validate(addresses_response) @@ -53,7 +53,7 @@ def get_peers(request_options: NodeAddresses) -> Peers: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore peers_response = response.json() return Peers.model_validate(peers_response) @@ -103,7 +103,7 @@ def remove_peer(request_options: BeeRequestOptions, peer: str) -> RemovePeerResp logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return RemovePeerResponse.model_validate(response.json()) @@ -127,7 +127,7 @@ def get_topology(request_options: BeeRequestOptions) -> Topology: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return Topology.model_validate(response.json()) @@ -149,6 +149,6 @@ def ping_peer(request_options: BeeRequestOptions, peer: str) -> PingResponse: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return PingResponse.model_validate(response.json()) diff --git a/src/bee_py/modules/debug/stake.py b/src/bee_py/modules/debug/stake.py index 5e50d42..e44b908 100644 --- a/src/bee_py/modules/debug/stake.py +++ b/src/bee_py/modules/debug/stake.py @@ -29,7 +29,7 @@ def get_stake(request_options: BeeRequestOptions) -> NumberString: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return response.json()["stakedAmount"] @@ -91,7 +91,7 @@ def get_redistribution_state(request_options: BeeRequestOptions) -> Redistributi logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore redistribution_state = response.json() diff --git a/src/bee_py/modules/debug/stamps.py b/src/bee_py/modules/debug/stamps.py index 14e886b..0ba9455 100644 --- a/src/bee_py/modules/debug/stamps.py +++ b/src/bee_py/modules/debug/stamps.py @@ -37,7 +37,7 @@ def get_global_postage_batches(request_options: BeeRequestOptions) -> list[Posta logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return parse_postage_batch(response.json()) @@ -60,7 +60,7 @@ def get_all_postage_batches(request_options: BeeRequestOptions) -> list[PostageB logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return parse_postage_batch(response.json()) @@ -87,7 +87,7 @@ def get_postage_batch( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return PostageBatch.model_validate(response.json()) @@ -114,7 +114,7 @@ def get_postage_batch_buckets( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore postage_batch_buckets = response.json() return PostageBatchBuckets.model_validate(postage_batch_buckets) @@ -166,7 +166,7 @@ def create_postage_batch( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore stamp_response = response.json() return stamp_response["batchID"] @@ -197,7 +197,7 @@ def top_up_batch( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore stamp_response = response.json() return stamp_response["batchID"] @@ -228,7 +228,7 @@ def dilute_batch( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore stamp_response = response.json() return stamp_response["batchID"] diff --git a/src/bee_py/modules/debug/states.py b/src/bee_py/modules/debug/states.py index 40930ce..7b02472 100644 --- a/src/bee_py/modules/debug/states.py +++ b/src/bee_py/modules/debug/states.py @@ -29,7 +29,7 @@ def get_reserve_state(request_options: BeeRequestOptions) -> ReserveState: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore reserve_state_response = response.json() return ReserveState.model_validate(reserve_state_response) @@ -53,7 +53,7 @@ def get_chain_state(request_options: BeeRequestOptions) -> ChainState: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore chain_state_response = response.json() return ChainState.model_validate(chain_state_response) @@ -101,8 +101,7 @@ def get_wallet_balance( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore - return None + return None # type: ignore wallet_balance_response = response.json() diff --git a/src/bee_py/modules/debug/status.py b/src/bee_py/modules/debug/status.py index fa200d7..8d196d8 100644 --- a/src/bee_py/modules/debug/status.py +++ b/src/bee_py/modules/debug/status.py @@ -38,7 +38,7 @@ def get_debug_status(request_options: BeeRequestOptions) -> DebugStatus: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore debug_status_response = response.json() return DebugStatus.model_validate(debug_status_response) @@ -62,7 +62,7 @@ def get_health(request_options: BeeRequestOptions) -> Health: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore health_response = response.json() return Health.model_validate(health_response) @@ -106,7 +106,7 @@ def get_node_info(request_options: BeeRequestOptions) -> NodeInfo: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore node_info_response = response.json() return NodeInfo.model_validate(node_info_response) diff --git a/src/bee_py/modules/debug/tag.py b/src/bee_py/modules/debug/tag.py index 7abbea0..257f66e 100644 --- a/src/bee_py/modules/debug/tag.py +++ b/src/bee_py/modules/debug/tag.py @@ -23,7 +23,7 @@ def retrieve_extended_tag(request_options: BeeRequestOptions, uid: int) -> Exten logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore debug_status_response = response.json() return ExtendedTag.model_validate(debug_status_response) diff --git a/src/bee_py/modules/debug/transactions.py b/src/bee_py/modules/debug/transactions.py index 4dc86f9..54d14e0 100644 --- a/src/bee_py/modules/debug/transactions.py +++ b/src/bee_py/modules/debug/transactions.py @@ -25,7 +25,7 @@ def get_all_transactions(request_options: BeeRequestOptions) -> list[Transaction logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore transactions_response = response.json() @@ -53,7 +53,7 @@ def get_transaction(request_options: BeeRequestOptions, transaction_hash: Transa logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore transaction_response = response.json() return TransactionInfo.model_validate(transaction_response) @@ -78,7 +78,7 @@ def rebroadcast_transaction(request_options: BeeRequestOptions, transaction_hash logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore rebroadcasted_transaction_response = response.json() return rebroadcasted_transaction_response["transactionHash"] @@ -117,7 +117,7 @@ def cancel_transaction( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore canceled_transaction_response = response.json() return canceled_transaction_response["transactionHash"] diff --git a/src/bee_py/modules/pinning.py b/src/bee_py/modules/pinning.py index 58e1ce5..9d0f0c6 100644 --- a/src/bee_py/modules/pinning.py +++ b/src/bee_py/modules/pinning.py @@ -28,7 +28,7 @@ def pin(request_options: Union[BeeRequestOptions, dict], reference: Union[Refere if response.raise_for_status(): if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore def unpin(request_options: Union[BeeRequestOptions, dict], reference: Union[Reference, str]) -> None: @@ -50,7 +50,7 @@ def unpin(request_options: Union[BeeRequestOptions, dict], reference: Union[Refe logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore def get_pin(request_options: Union[BeeRequestOptions, dict], reference: Union[Reference, str]) -> Pin: @@ -78,7 +78,7 @@ def get_pin(request_options: Union[BeeRequestOptions, dict], reference: Union[Re logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return Pin.model_validate(response.json()) @@ -101,7 +101,7 @@ def get_all_pins(request_options: Union[BeeRequestOptions, dict]) -> GetAllPinRe logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore response_data = response.json() # print("Response data--->", response_data) diff --git a/src/bee_py/modules/pss.py b/src/bee_py/modules/pss.py index 7d1699a..73b9e61 100644 --- a/src/bee_py/modules/pss.py +++ b/src/bee_py/modules/pss.py @@ -50,7 +50,7 @@ def send( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore async def subscribe(url: str, topic: str) -> websockets.WebSocketClientProtocol: diff --git a/src/bee_py/modules/soc.py b/src/bee_py/modules/soc.py index f7051ec..4715327 100644 --- a/src/bee_py/modules/soc.py +++ b/src/bee_py/modules/soc.py @@ -55,6 +55,6 @@ def upload( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return response.json()["reference"] diff --git a/src/bee_py/modules/stewardship.py b/src/bee_py/modules/stewardship.py index d32c56f..54bda95 100644 --- a/src/bee_py/modules/stewardship.py +++ b/src/bee_py/modules/stewardship.py @@ -33,7 +33,7 @@ def reupload( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore def is_retrievable( @@ -58,6 +58,6 @@ def is_retrievable( logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore return IsRetrievableResponse(is_retrievable=response.json()["isRetrievable"]) diff --git a/src/bee_py/modules/tag.py b/src/bee_py/modules/tag.py index 4682ec0..f7d7402 100644 --- a/src/bee_py/modules/tag.py +++ b/src/bee_py/modules/tag.py @@ -34,7 +34,7 @@ def create_tag(request_options: Union[BeeRequestOptions, dict], address: Optiona logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore tag_response = response.json() return Tag.model_validate(tag_response) @@ -61,7 +61,7 @@ def retrieve_tag(request_options: Union[BeeRequestOptions, dict], uid: int) -> T logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore tag_response = response.json() return Tag.model_validate(tag_response) @@ -100,7 +100,7 @@ def get_all_tags(request_options: Union[BeeRequestOptions, dict], offset: int = logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore tag_response = response.json()["tags"] @@ -130,7 +130,7 @@ def delete_tag(request_options: BeeRequestOptions, uid: int) -> None: logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore def update_tag(request_options: Union[BeeRequestOptions, dict], uid: int, reference: Union[Reference, str]) -> None: @@ -157,4 +157,4 @@ def update_tag(request_options: Union[BeeRequestOptions, dict], uid: int, refere logger.info(response.json()) if response.raise_for_status(): logger.error(response.raise_for_status()) # type: ignore - return None # type: ignore + return None # type: ignore