@@ -110,29 +110,30 @@ from hiero_sdk_python.account.account_create_transaction import AccountCreateTra
110110from hiero_sdk_python.crypto.private_key import PrivateKey
111111from hiero_sdk_python.hbar import Hbar
112112from hiero_sdk_python.response_code import ResponseCode
113- from tests.integration.utils_for_test import IntegrationTestEnv
113+ from tests.integration.utils import IntegrationTestEnv
114+
114115
115116@pytest.mark.integration
116117def test_integration_account_create_transaction_can_execute ():
117- """ Test that an account can be created on the network."""
118- env = IntegrationTestEnv()
119- try :
120- new_account_private_key = PrivateKey.generate()
121- new_account_public_key = new_account_private_key.public_key()
122- initial_balance = Hbar(2 )
123-
124- transaction = AccountCreateTransaction(
125- key = new_account_public_key,
126- initial_balance = initial_balance,
127- memo = " Test Account"
128- )
129- transaction.freeze_with(env.client)
130- receipt = transaction.execute(env.client)
131-
132- assert receipt.account_id is not None , " Account ID should be present"
133- assert receipt.status == ResponseCode.SUCCESS
134- finally :
135- env.close()
118+ """ Test that an account can be created on the network."""
119+ env = IntegrationTestEnv()
120+ try :
121+ new_account_private_key = PrivateKey.generate()
122+ new_account_public_key = new_account_private_key.public_key()
123+ initial_balance = Hbar(2 )
124+
125+ transaction = AccountCreateTransaction(
126+ key = new_account_public_key,
127+ initial_balance = initial_balance,
128+ memo = " Test Account"
129+ )
130+ transaction.freeze_with(env.client)
131+ receipt = transaction.execute(env.client)
132+
133+ assert receipt.account_id is not None , " Account ID should be present"
134+ assert receipt.status == ResponseCode.SUCCESS
135+ finally :
136+ env.close()
136137```
137138
138139### When to Write Integration Tests
@@ -328,13 +329,13 @@ uv run pytest -m integration
328329#### Run Specific Test File
329330
330331``` bash
331- uv run pytest tests/unit/test_hbar .py
332+ uv run pytest tests/unit/hbar_test .py
332333```
333334
334335#### Run Specific Test Function
335336
336337``` bash
337- uv run pytest tests/unit/test_hbar .py::test_hbar_conversion_to_tinybars
338+ uv run pytest tests/unit/hbar_test .py::test_hbar_conversion_to_tinybars
338339```
339340
340341#### Run Tests with Verbose Output
@@ -457,7 +458,7 @@ You may look at an already-created unit test file for better clarity:
457458
458459``` bash
459460# Run unit tests
460- uv run pytest tests/unit/tokens/test_token_transfer .py -v
461+ uv run pytest tests/unit/tokens/token_transfer_test .py -v
461462
462463# Run integration tests
463464uv run pytest tests/integration/token_transfer_e2e_test.py -v
@@ -607,15 +608,16 @@ def test_with_fixtures(sample_account_id, sample_token_id):
607608The ` env ` fixture from ` utils_for_test.py ` provides a configured test environment:
608609
609610``` python
610- from tests.integration.utils_for_test import env
611+ from tests.integration.utils import env
612+
611613
612614@pytest.mark.integration
613615def test_with_env_fixture (env ):
614- """ Test using the env fixture."""
615- # env.client is already configured
616- # env.operator_id and env.operator_key are available
617- account = env.create_account() # Helper method
618- assert account.id is not None
616+ """ Test using the env fixture."""
617+ # env.client is already configured
618+ # env.operator_id and env.operator_key are available
619+ account = env.create_account() # Helper method
620+ assert account.id is not None
619621```
620622
621623#### 2. ** Always Clean Up Resources**
@@ -720,21 +722,22 @@ The `tests/integration/utils_for_test.py` file provides essential testing utilit
720722#### IntegrationTestEnv Class
721723
722724``` python
723- from tests.integration.utils_for_test import IntegrationTestEnv, env
725+ from tests.integration.utils import IntegrationTestEnv, env
724726
725727# Create environment manually
726728env = IntegrationTestEnv()
727729try :
728- # Use env.client, env.operator_id, env.operator_key
729- pass
730+ # Use env.client, env.operator_id, env.operator_key
731+ pass
730732finally :
731- env.close()
733+ env.close()
734+
732735
733736# Or use the pytest fixture (recommended)
734737@pytest.mark.integration
735738def test_example (env ):
736- # env is automatically created and cleaned up
737- account = env.create_account()
739+ # env is automatically created and cleaned up
740+ account = env.create_account()
738741```
739742
740743** Key Methods:**
@@ -747,25 +750,26 @@ def test_example(env):
747750#### Helper Functions
748751
749752``` python
750- from tests.integration.utils_for_test import (
751- create_fungible_token,
752- create_nft_token,
753- env
753+ from tests.integration.utils import (
754+ create_fungible_token,
755+ create_nft_token,
756+ env
754757)
755758
759+
756760@pytest.mark.integration
757761def test_with_helpers (env ):
758- # Create a fungible token with default settings
759- token_id = create_fungible_token(env)
760-
761- # Create an NFT token
762- nft_id = create_nft_token(env)
763-
764- # Use custom configuration with lambdas
765- token_id = create_fungible_token(env, [
766- lambda tx : tx.set_decimals(8 ),
767- lambda tx : tx.set_initial_supply(1000000 )
768- ])
762+ # Create a fungible token with default settings
763+ token_id = create_fungible_token(env)
764+
765+ # Create an NFT token
766+ nft_id = create_nft_token(env)
767+
768+ # Use custom configuration with lambdas
769+ token_id = create_fungible_token(env, [
770+ lambda tx : tx.set_decimals(8 ),
771+ lambda tx : tx.set_initial_supply(1000000 )
772+ ])
769773```
770774
771775### Pytest Markers
0 commit comments