-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] #201: Add tests for transaction queries
Signed-off-by: Sam H. Smith <[email protected]>
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import allure # type: ignore | ||
import pytest | ||
|
||
@pytest.fixture(scope="function", autouse=True) | ||
def asset_test_setup(): | ||
allure.dynamic.feature("Transactions") | ||
allure.dynamic.story("Account queries transactions") | ||
allure.dynamic.label("permission", "no_permission_required") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import allure | ||
import iroha | ||
|
||
from tests import client,account_id | ||
from tests.helpers import generate_public_key | ||
|
||
|
||
@allure.label("sdk_test_id", "query_all_transactions") | ||
def test_query_all_transactions(GIVEN_hash_of_registered_transaction): | ||
with allure.step('WHEN client queries all transactions'): | ||
all_txs = client.query_all_transactions() | ||
with allure.step('THEN there should be some transactions present'): | ||
assert len(all_txs) > 0, "No transactions found in the system" | ||
|
||
|
||
@allure.label("sdk_test_id", "query_all_transactions_by_account") | ||
def test_query_all_transactions_by_account( | ||
GIVEN_hash_of_registered_transaction): | ||
with allure.step('WHEN client queries all transactions by their own account'): | ||
all_txs = client.query_all_transactions_by_account(account_id) | ||
with allure.step('THEN there should be some transactions present'): | ||
assert len(all_txs) > 0, "No transactions found in the system" | ||
|
||
@allure.label("sdk_test_id", "test_query_transaction_by_hash") | ||
def test_query_transaction_by_hash( | ||
GIVEN_hash_of_registered_transaction): | ||
with allure.step( | ||
f'WHEN client queries for transaction by hash {GIVEN_hash_of_registered_transaction}"'): | ||
tx = client.query_transaction_by_hash(bytes.fromhex(GIVEN_hash_of_registered_transaction)) | ||
with allure.step('THEN there should be a transaction present'): | ||
assert tx is not None, "No transactions found in the system" |