-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#86drpnck9 - Refactor example_tests/test_update_contract.py to use Bo… #1229
Conversation
self.compile(path_new) | ||
@classmethod | ||
def setupTestCase(cls): | ||
cls.owner = cls.node.wallet.account_new(label='owner', password='123') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
@classmethod | ||
def setupTestCase(cls): | ||
cls.owner = cls.node.wallet.account_new(label='owner', password='123') | ||
cls.other_account = cls.node.wallet.account_new(label='otherAccount', password='123') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
def test_update_contract(self): | ||
path, _ = self.get_deploy_file_paths('update_contract.py') | ||
runner = BoaTestRunner(runner_id=self.method_name()) | ||
super().setupTestCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
def test_update_contract(self): | ||
path, _ = self.get_deploy_file_paths('update_contract.py') | ||
runner = BoaTestRunner(runner_id=self.method_name()) | ||
super().setupTestCase() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
invokes = [] | ||
expected_results = [] | ||
@classmethod | ||
async def asyncSetupClass(cls) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
expected_results = [] | ||
@classmethod | ||
async def asyncSetupClass(cls) -> None: | ||
await super().asyncSetupClass() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
|
||
test_account = self.OTHER_ACCOUNT | ||
test_account_script_hash = test_account.script_hash.to_array() | ||
await cls.transfer(CONTRACT_HASHES.GAS_TOKEN, cls.genesis.script_hash, cls.owner.script_hash, 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
test_account = self.OTHER_ACCOUNT | ||
test_account_script_hash = test_account.script_hash.to_array() | ||
await cls.transfer(CONTRACT_HASHES.GAS_TOKEN, cls.genesis.script_hash, cls.owner.script_hash, 100) | ||
await cls.transfer(CONTRACT_HASHES.GAS_TOKEN, cls.genesis.script_hash, cls.other_account.script_hash, 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
runner.add_gas(self.OWNER.address, self.GAS_TO_DEPLOY) | ||
update_contract = runner.deploy_contract(path, account=self.OWNER) | ||
runner.update_contracts(export_checkpoint=True) | ||
await cls.set_up_contract('update_contract.py', signing_account=cls.owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
runner.add_gas(self.OWNER.address, self.GAS_TO_DEPLOY) | ||
update_contract = runner.deploy_contract(path, account=self.OWNER) | ||
runner.update_contracts(export_checkpoint=True) | ||
await cls.set_up_contract('update_contract.py', signing_account=cls.owner) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using a more descriptive name for the variable cls
. It would improve code readability.
Summary or solution description
Refactored
example_tests/test_update_contract.py
files to useBoaTestCase
in place ofBoaTest
for unit testing.