def test_mining_submit_nonce(self, client): nonce = client.wallet_mining_api.submit_nonce( secret_pass=PyBurstLibConfig.get('account_pw'), nonce="100000", account_id=PyBurstLibConfig.get('account_id')) assert isinstance(nonce, SubmitNonceResponse) assert nonce.result == SubmitNonceResponse.SUCCESS
def test_set_reward_recipient(self, client): reward_req = SetRewardRecipientRequest( recipient=PyBurstLibConfig.get('account_address'), secretPhrase=PyBurstLibConfig.get('account_pw') ) set_reward = client.wallet_accounts_api.set_reward_recipient(req=reward_req.as_dict()) assert isinstance(set_reward, SetRewardRecipientResponse) assert isinstance(set_reward.transactionJSON, TransactionJSON) assert set_reward.transactionJSON.feeNQT == SetRewardRecipientRequest.DEFAULT_REWARD_RECIPIENT_FEE
def test_account_send_money(self, client): send_req = SendMoneyRequest( recipient=PyBurstLibConfig.get('account_address2'), amountNQT=100000000, secretPhrase=PyBurstLibConfig.get('account_pw') ) send = client.wallet_accounts_api.send_money(req=send_req.as_dict()) assert isinstance(send, SendMoneyResponse) assert isinstance(send.transactionJSON, TransactionJSON) assert send.transactionJSON.feeNQT == SendMoneyRequest.DEFAULT_SEND_MONEY_FEE
def test_set_account_info(self, client): test_name = 'unit-test-name-{}'.format(str(randint(0, 100))) info_req = SetAccountInfoRequest( name=test_name, secretPhrase=PyBurstLibConfig.get('account_pw') ) set_info = client.wallet_accounts_api.set_account_info(req=info_req.as_dict()) assert isinstance(set_info, SetAccountInfoResponse) assert isinstance(set_info.transactionJSON, TransactionJSON) assert set_info.transactionJSON.attachment.name == test_name assert set_info.transactionJSON.feeNQT == SetAccountInfoRequest.DEFAULT_ACCOUNT_INFO_FEE
def client(): from tests.config import PyBurstLibConfig from pyburstlib.client import BurstAPIClient test_node = PyBurstLibConfig.get('node_url') node_port = PyBurstLibConfig.get('node_port') yield BurstAPIClient(node_url=test_node, node_port=node_port)
def setup(self): self.TEST_ACCOUNT_NUMERIC = PyBurstLibConfig.get('account_id') self.TEST_ACCOUNT_ADDRESS = PyBurstLibConfig.get('account_address')
def setup(self): self.TEST_ACCOUNT_NUMERIC = PyBurstLibConfig.get('account_id')
''' pyburstlib :author: drownedcoast :date: 3-24-2018 ''' from time import sleep, time from tests.config import PyBurstLibConfig WAIT_TIMEOUT = int(PyBurstLibConfig.get('wait_timeout')) class BaseTest(object): def setup_method(self, method): if not hasattr(self, '_timer'): self._timer = {} print("\n%s:%s is running." % (type(self).__name__, method.__name__)) self._timer[method.__name__] = time() def teardown_method(self, method): duration = time() - self._timer[method.__name__] print("\n%s:%s took (%s seconds)." % (type(self).__name__, method.__name__, duration))