From 44f26607b2e01864ccd6a971d9cad091994366ec Mon Sep 17 00:00:00 2001 From: drcpu Date: Thu, 14 Mar 2024 22:03:46 +0100 Subject: [PATCH] [format] Rerun updated formatting packages --- api/__init__.py | 6 +++--- schemas/component/commit_schema.py | 6 +++--- schemas/component/mint_schema.py | 6 +++--- schemas/component/tally_schema.py | 6 +++--- tests/api/search/test_hash.py | 12 ++++++------ tests/schemas/component/test_block_schema.py | 6 +++--- tests/schemas/component/test_commit_schema.py | 6 +++--- .../component/test_data_request_schema.py | 18 +++++++++--------- tests/schemas/component/test_reveal_schema.py | 12 ++++++------ tests/schemas/component/test_tally_schema.py | 12 ++++++------ .../schemas/include/test_input_utxo_schema.py | 6 +++--- .../search/test_data_request_history_schema.py | 18 +++++++++--------- 12 files changed, 57 insertions(+), 57 deletions(-) diff --git a/api/__init__.py b/api/__init__.py index cfbea8e5..66da97eb 100644 --- a/api/__init__.py +++ b/api/__init__.py @@ -56,9 +56,9 @@ def create_app(mock=False): app.config["OPENAPI_VERSION"] = "3.0.3" app.config["OPENAPI_URL_PREFIX"] = "/api" app.config["OPENAPI_RAPIDOC_PATH"] = "/documentation" - app.config[ - "OPENAPI_RAPIDOC_URL" - ] = "https://cdn.jsdelivr.net/npm/rapidoc/dist/rapidoc-min.js" + app.config["OPENAPI_RAPIDOC_URL"] = ( + "https://cdn.jsdelivr.net/npm/rapidoc/dist/rapidoc-min.js" + ) app.config["OPENAPI_RAPIDOC_CONFIG"] = { "allow-authentication": "false", "allow-spec-file-download": "true", diff --git a/schemas/component/commit_schema.py b/schemas/component/commit_schema.py index ba6c2eda..d1924c54 100644 --- a/schemas/component/commit_schema.py +++ b/schemas/component/commit_schema.py @@ -34,8 +34,8 @@ def validate_inputs(self, args, **kwargs): if len(args["input_values"]) < 1: errors["input_values"] = "Need at least one input value." if len(args["input_utxos"]) != len(args["input_values"]): - errors[ - "input_utxos" - ] = "Number of input UTXO's and input values is different." + errors["input_utxos"] = ( + "Number of input UTXO's and input values is different." + ) if len(errors) > 0: raise ValidationError(errors) diff --git a/schemas/component/mint_schema.py b/schemas/component/mint_schema.py index e33bc6c4..599d4bd0 100644 --- a/schemas/component/mint_schema.py +++ b/schemas/component/mint_schema.py @@ -17,9 +17,9 @@ def validate_inputs(self, args, **kwargs): if len(args["output_addresses"]) < 1: errors["output_addresses"] = "Need at least one output address." if len(args["output_addresses"]) != len(args["output_values"]): - errors[ - "output_values" - ] = "Number of output addresses and values is different." + errors["output_values"] = ( + "Number of output addresses and values is different." + ) if len(errors): raise ValidationError(errors) diff --git a/schemas/component/tally_schema.py b/schemas/component/tally_schema.py index ebe75e83..3c133076 100644 --- a/schemas/component/tally_schema.py +++ b/schemas/component/tally_schema.py @@ -17,9 +17,9 @@ def validate_sizes(self, args, **kwargs): if len(args["output_addresses"]) < 1: errors["output_addresses"] = "Need at least one output address." if len(args["output_addresses"]) != len(args["output_values"]): - errors[ - "output_values" - ] = "Size of output addresses and output values does not match." + errors["output_values"] = ( + "Size of output addresses and output values does not match." + ) if len(errors): raise ValidationError(errors) diff --git a/tests/api/search/test_hash.py b/tests/api/search/test_hash.py index c01f9604..e8b22731 100644 --- a/tests/api/search/test_hash.py +++ b/tests/api/search/test_hash.py @@ -355,9 +355,9 @@ def test_search_data_request_history_RAD_page_1(client, data_request_history_rad "page": 1, "next_page": 2, } - data_request_history_rad["data_request_history"][ - "history" - ] = data_request_history_rad["data_request_history"]["history"][:5] + data_request_history_rad["data_request_history"]["history"] = ( + data_request_history_rad["data_request_history"]["history"][:5] + ) assert json.loads(response.data) == data_request_history_rad @@ -374,7 +374,7 @@ def test_search_data_request_history_RAD_page_2(client, data_request_history_rad "page": 2, "previous_page": 1, } - data_request_history_rad["data_request_history"][ - "history" - ] = data_request_history_rad["data_request_history"]["history"][5:] + data_request_history_rad["data_request_history"]["history"] = ( + data_request_history_rad["data_request_history"]["history"][5:] + ) assert json.loads(response.data) == data_request_history_rad diff --git a/tests/schemas/component/test_block_schema.py b/tests/schemas/component/test_block_schema.py index 7e65ebc1..017567af 100644 --- a/tests/schemas/component/test_block_schema.py +++ b/tests/schemas/component/test_block_schema.py @@ -29,9 +29,9 @@ def test_block_details_success(block_details): def test_block_details_failure_hash(block_details): - block_details[ - "hash" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + block_details["hash"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: BlockDetails().load(block_details) assert err_info.value.messages["hash"][0] == "Hash is not a hexadecimal value." diff --git a/tests/schemas/component/test_commit_schema.py b/tests/schemas/component/test_commit_schema.py index 6b59bc4a..9a5c41ac 100644 --- a/tests/schemas/component/test_commit_schema.py +++ b/tests/schemas/component/test_commit_schema.py @@ -70,9 +70,9 @@ def test_commit_transaction_for_block_success(commit_transaction_for_block): def test_commit_transaction_for_block_failure_hash(commit_transaction_for_block): - commit_transaction_for_block[ - "data_request" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + commit_transaction_for_block["data_request"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: CommitTransactionForBlock().load(commit_transaction_for_block) assert ( diff --git a/tests/schemas/component/test_data_request_schema.py b/tests/schemas/component/test_data_request_schema.py index 8a6854a2..c523907e 100644 --- a/tests/schemas/component/test_data_request_schema.py +++ b/tests/schemas/component/test_data_request_schema.py @@ -47,12 +47,12 @@ def test_data_request_failure_address(data_request): def test_data_request_failure_hash(data_request): - data_request[ - "RAD_bytes_hash" - ] = "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef012345678" - data_request[ - "DRO_bytes_hash" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + data_request["RAD_bytes_hash"] = ( + "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef012345678" + ) + data_request["DRO_bytes_hash"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: DataRequest().load(data_request) assert len(err_info.value.messages) == 2 @@ -380,9 +380,9 @@ def test_data_request_transaction_for_explorer_success_none( def test_data_request_transaction_for_explorer_failure_address( data_request_transaction_for_explorer, ): - data_request_transaction_for_explorer[ - "output_address" - ] = "wit100000000000000000000000000000000r0v4g" + data_request_transaction_for_explorer["output_address"] = ( + "wit100000000000000000000000000000000r0v4g" + ) with pytest.raises(ValidationError) as err_info: DataRequestTransactionForExplorer().load(data_request_transaction_for_explorer) assert ( diff --git a/tests/schemas/component/test_reveal_schema.py b/tests/schemas/component/test_reveal_schema.py index 7da8e82b..9e1cd1c2 100644 --- a/tests/schemas/component/test_reveal_schema.py +++ b/tests/schemas/component/test_reveal_schema.py @@ -61,9 +61,9 @@ def test_reveal_transaction_for_block_success(reveal_transaction_for_block): def test_reveal_transaction_for_block_failure_hash(reveal_transaction_for_block): - reveal_transaction_for_block[ - "data_request" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + reveal_transaction_for_block["data_request"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: RevealTransactionForBlock().load(reveal_transaction_for_block) assert ( @@ -152,9 +152,9 @@ def test_reveal_transaction_for_explorer_success(reveal_transaction_for_explorer def test_reveal_transaction_for_explorer_failure_hash(reveal_transaction_for_explorer): - reveal_transaction_for_explorer[ - "data_request" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + reveal_transaction_for_explorer["data_request"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: RevealTransactionForExplorer().load(reveal_transaction_for_explorer) assert ( diff --git a/tests/schemas/component/test_tally_schema.py b/tests/schemas/component/test_tally_schema.py index 955e914d..f5c5a3e5 100644 --- a/tests/schemas/component/test_tally_schema.py +++ b/tests/schemas/component/test_tally_schema.py @@ -215,9 +215,9 @@ def test_tally_transaction_for_block_success(tally_transaction_for_block): def test_tally_transaction_for_block_failure_hash(tally_transaction_for_block): - tally_transaction_for_block[ - "data_request" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + tally_transaction_for_block["data_request"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: TallyTransactionForBlock().load(tally_transaction_for_block) assert ( @@ -324,9 +324,9 @@ def test_tally_transaction_for_explorer_success(tally_transaction_for_explorer): def test_tally_transaction_for_explorer_failure_hash(tally_transaction_for_explorer): - tally_transaction_for_explorer[ - "data_request" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + tally_transaction_for_explorer["data_request"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: TallyTransactionForExplorer().load(tally_transaction_for_explorer) assert ( diff --git a/tests/schemas/include/test_input_utxo_schema.py b/tests/schemas/include/test_input_utxo_schema.py index a3b55bc3..585624db 100644 --- a/tests/schemas/include/test_input_utxo_schema.py +++ b/tests/schemas/include/test_input_utxo_schema.py @@ -56,9 +56,9 @@ def test_input_utxo_pointer_success(input_utxo_pointer): def test_input_utxo_pointer_failure_pointer(input_utxo_pointer): - input_utxo_pointer[ - "input_utxo" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789:0" + input_utxo_pointer["input_utxo"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789:0" + ) with pytest.raises(ValidationError) as err_info: InputUtxoPointer().load(input_utxo_pointer) assert ( diff --git a/tests/schemas/search/test_data_request_history_schema.py b/tests/schemas/search/test_data_request_history_schema.py index f96dd670..aa544338 100644 --- a/tests/schemas/search/test_data_request_history_schema.py +++ b/tests/schemas/search/test_data_request_history_schema.py @@ -41,9 +41,9 @@ def test_data_request_history_entry_success_minimal(data_request_history_entry): def test_data_request_history_entry_failure_hash(data_request_history_entry): - data_request_history_entry[ - "data_request" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + data_request_history_entry["data_request"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: DataRequestHistoryEntry().load(data_request_history_entry) assert ( @@ -164,12 +164,12 @@ def test_data_request_history_failure_type(data_request_history): def test_data_request_history_failure_hash(data_request_history): - data_request_history[ - "hash" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" - data_request_history[ - "RAD_bytes_hash" - ] = "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + data_request_history["hash"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) + data_request_history["RAD_bytes_hash"] = ( + "zbcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef0123456789" + ) with pytest.raises(ValidationError) as err_info: DataRequestHistory().load(data_request_history) assert len(err_info.value.messages) == 2