The project is intended for testing Echo project. Includes testing:
- Echo Node API
- Echo Operations
- Testing according to specified scenarios
Software Requirements: Python 3.7 or later
$ git clone https://github.com/echoprotocol/pytests.git
$ cd pytests
$ python3 -m pip install --user virtualenv
$ virtualenv <ENVIRONMENT_NAME>
$ .\<ENVIRONMENT_NAME>\Scripts\activate
$ pip3 install -r requirements.txt
$ export GENESIS_FILE=genesis.json
$ git clone https://github.com/echoprotocol/pytests.git
$ cd pytests
$ virtualenv <ENVIRONMENT_NAME> -p python3.7
$ source <ENVIRONMENT_NAME>/bin/activate
$ pip3 install -r requirements.txt
$ export GENESIS_FILE=genesis.json
please see Linux installation
- BASE_URL - URL on which tests will be connected to the Echo node
- ETHEREUM_URL - URL on which tests will be connected to the Ethereum node
- NATHAN_PK - private key of "nathan" account
- INIT0_PK - private key of "init0" initial account
- GENESIS_FILE - Echo node genesis file
- ROPSTEN - flag to run tests in the ropsten network (bool type)
- DEBUG - run tests with debug mode that log all in\out communication messages with Echo node (bool type)
- Linux OS: export BASE_URL=<BASE_URL>
- Windows OS: set BASE_URL=<BASE_URL>
$ cd pytests
$ docker-compose pull
$ docker-compose up build --no-cache
$ docker-compose up migrate
$ docker-compose up -d echo
$ docker-compose up pytests
Filter | lcc commands |
---|---|
Run all tests | $ lcc run |
Run tests with special tag | $ lcc run -a tag_name |
Run tests with special property | $ lcc run -m property_kind:property_name |
Run tests with special link | $ lcc run -l link_name |
Run only passed tests | $ lcc run --passed |
Run only failed tests | $ lcc run --failed |
Run only skipped tests | $ lcc run --skipped |
Run only non-passed tests | $ lcc run --non-passed |
Run only disabled tests | $ lcc run --disabled |
Run only enabled tests | $ lcc run --enabled |
Run tests from special report | $ lcc run --from-report path_to_report |
note: can combine run options, for example - $ lcc run --failed --from-report reports/report-2
Using test_runner.py
script to run tests, you can specify a environment variable PYTESTS_FILTERS for filtering run command.
Example: export PYTESTS_FILTERS=main:database_api
For more information about filters see test_runner.py
script.
├── common
│  ├── base_test.py
│  ├── echo_operation.py
│  ├── ethereum_transaction.py
│  ├── object_validation.py
│  ├── receiver.py
│  ├── type_validation.py
│  └── utils.py
├── fixtures
│ └── base_fixtures.py
├── pre_run_scripts
│ └── pre_deploy.py
├── resources
│ ├── echo_contracts.json
│ ├── echo_operations.json
│ ├── ethereum_contracts.json
│ ├── ethereum_transactions.json
│ ├── private_keys.json (optional)
│ ├── urls.json
│ └── wallets.json (optional)
├── suites
│  ├── AssetApi
│  │  ├── GetAllAssetHolders.py
│  │  ├── GetAssetHoldersCount.py
│  │  ├── GetAssetHolders.py
│ ├── DatabaseApi
│ │ ├── CallContractNoChangingState.py
│ │ ├── CheckERC20Token.py
│ │ └── ...
│ ├── DID Api
│ │ └── Get_did_object.py
│ ├── HistoryApi
│ │ ├── GetAccountHistory.py
│ │ ├── GetAccountHistoryOperations.py
│ │ ├── GetContractHistory.py
│ │ └── GetRelativeAccountHistory.py
│ ├── NetworkBroadcastApi
│ │ ├── BroadcastTransaction.py
│ │ ├── BroadcastTransactionSynchronous.py
│ │ └── BroadcastTransactionWithCallback.py
│ ├── Operations
│ │ ├── AccountManagement.py
│ │ ├── AssetManagement.py
│ │ └── ...
│ ├── RegistrationApi
│ │ ├── GetRegistrar.py
│ │ ├── RequestRegistrationTask.py
│ │ └── SubmitRegistrationSolution.py
│ ├── Scenarios
│ │ ├── AssetInt.py
│ │ ├── AssetUpdate.py
│ │ └── ...
│ ├── SideChain
│ │ ├── Bitcoin.py
│ │ ├── ERC20.py
│ │ └── Ethereum.py
│ ├── AssetApi.py
│ ├── DatabaseApi.py
│ ├── HistoryApi.py
│ ├── LoginApi.py
│ ├── NetworkBroadcastApi.py
│ ├── Operations.py
│ ├── RegistrationApi.py
│ ├── Scenarios.py
│ └── SideChain.py
├── .env
├── .flake8
├── .gitignore
├── .gitlab-ci.yml
├── .travis.yml
├── docker-compose.yml
├── Dockerfile
├── genesis.json
├── genesis_update_global_parameters.json
├── project.py
├── README.md
├── requirements.txt
└── test_runner.py
- set_subscribe_callback
- set_pending_transaction_callback
- set_block_applied_callback
- cancel_all_subscriptions
- unsubscribe_contract_logs
- get_block_header
- get_block_header_batch
- get_block
- get_block_tx_number
- get_block_virtual_ops
- get_transaction
- get_recent_transaction_by_id
- get_accounts
- get_full_accounts
- get_account_by_name
- get_account_references
- lookup_account_names
- lookup_accounts
- get_account_addresses
- get_account_by_address
- get_account_count
- get_contract
- get_contracts
- get_contract_logs
- subscribe_contracts
- subscribe_contract_logs
- get_contract_result
- call_contract_no_changing_state
- [did_create]
- [did_delete]
- [did_update]
- get_account_balances
- get_contract_balances
- get_named_account_balances
- get_balance_objects
- get_vested_balances
- get_vesting_balances
- get_frozen_balances
- get_committee_frozen_balance
- get_committee_members
- get_committee_member_by_account
- lookup_committee_member_accounts
- get_committee_count
- get_transaction_hex
- get_required_signatures
- get_potential_signatures
- verify_authority
- verify_account_authority
- validate_transaction
- get_required_fees
- get_eth_address
- [get_eth_sidechain_fees]
- get_btc_address
- get_btc_deposit_script
- [get_btc_sidechain_fees]
- get_account_history
- get_account_history_operations
- get_relative_account_history
- get_contract_history
- broadcast_transaction
- broadcast_transaction_with_callback
- broadcast_transaction_synchronous
- broadcast_block
- account_create_operation
- account_update_operation
- account_whitelist_operation
- account_address_create_operation
- asset_create_operation
- asset_update_operation
- asset_update_bitasset_operation
- asset_update_feed_producers_operation
- asset_issue_operation
- asset_reserve_operation
- asset_fund_fee_pool_operation
- asset_publish_feed_operation
- asset_claim_fees_operation
- committee_member_create_operation
- committee_member_update_operation
- committee_member_update_global_parameters_operation
- committee_member_activate_operation
- committee_member_deactivate_operation
- committee_frozen_balance_deposit_operation
- committee_frozen_balance_withdraw_operation
- contract_create_operation
- contract_call_operation
- contract_internal_create_operation [VIRTUAL]
- contract_internal_call_operation [VIRTUAL]
- contract_selfdestruct_operation [VIRTUAL]
- contract_update_operation
- contract_fund_pool_operation
- contract_whitelist_operation
- sidechain_eth_create_address_operation
- sidechain_eth_approve_address_operation [INTERNAL]
- sidechain_eth_deposit_operation [INTERNAL]
- sidechain_eth_withdraw_operation
- sidechain_eth_approve_withdraw_operation [INTERNAL]
- sidechain_issue_operation [VIRTUAL]
- sidechain_burn_operation [VIRTUAL]
- sidechain_erc20_register_token_operation
- sidechain_erc20_deposit_token_operation [INTERNAL]
- sidechain_erc20_withdraw_token_operation
- sidechain_erc20_approve_token_withdraw_operation [INTERNAL]
- sidechain_erc20_issue_operation [VIRTUAL]
- sidechain_erc20_burn_operation [VIRTUAL]
- sidechain_btc_create_address_operation
- sidechain_btc_create_intermediate_deposit_operation [INTERNAL]
- sidechain_btc_intermediate_deposit_operation [INTERNAL]
- sidechain_btc_deposit_operation [INTERNAL]
- sidechain_btc_withdraw_operation
- sidechain_btc_aggregate_operation [INTERNAL]
- sidechain_btc_approve_aggregate_operation [INTERNAL]