From 8774839dbef5d3d677196a353fc77cd12a2f7198 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 03:46:53 +0300 Subject: [PATCH] update --- README.md | 6 +++--- robot/resources/lib/payment_neogo.py | 26 +++++++------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 8f03263..df1f71e 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ python3 -m robot.testdoc robot/testsuites/integration/ docs/testcases.html `robot/testsuites/fi/` - Fault Injection test suites and test cases -## Code style +### Code style Robot Framework keyword should use space as a separator between particular words @@ -99,10 +99,10 @@ Name of other variables should not be ended with underscore symbol On keywords definition, one should specify variable type, e.g. path: str -## Robot style +### Robot style Следует всегда заполнять секции [Tags] и [Documentation] для Testcase'ов и Documentation для Test Suite'ов. -## Robot-framework User Guide +### Robot-framework User Guide http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html \ No newline at end of file diff --git a/robot/resources/lib/payment_neogo.py b/robot/resources/lib/payment_neogo.py index 6c532d5..9c2ae85 100644 --- a/robot/resources/lib/payment_neogo.py +++ b/robot/resources/lib/payment_neogo.py @@ -100,10 +100,13 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int out = _run_sh_with_passwd('', cmd) logger.info(f"Command completed with output: {out}") - #if not re.match(r'^(\w{64})$', out): - # raise Exception("Can not get Tx.") + m = re.match(r'^Sent invocation transaction (\w{64})$', out) + if m is None: + raise Exception("Can not get Tx.") + + tx = m.group(1) - return out + return tx @keyword('Mainnet Balance') @@ -127,7 +130,7 @@ def mainnet_balance(address: str): @keyword('Expexted Mainnet Balance') -def expected_mainnet_balance(address: str, expected: int): +def expected_mainnet_balance(address: str, expected: float): amount = mainnet_balance(address) @@ -198,21 +201,6 @@ def get_transaction(tx_id: str): logger.info(complProc.stdout) -@keyword('Request NeoFS Deposit') -def request_neofs_deposit(public_key: str): - """ - This function requests Deposit to the selected public key. - :param public_key: neo public key - """ - - response = requests.get('https://fs.localtest.nspcc.ru/api/deposit/'+str(public_key), verify='ca/nspcc-ca.pem') - - if response.status_code != 200: - BuiltIn().fatal_error('Can not run Deposit to {} with error: {}'.format(public_key, response.text)) - else: - logger.info("Deposit has been completed for '%s'; tx: '%s'" % (public_key, response.text) ) - - return response.text @keyword('Get Balance') def get_balance(privkey: str):