Skip to content
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

Break v2_step.py into account_, application_, and other_ #341

Merged
merged 1 commit into from Jun 3, 2022

Conversation

tzaffi
Copy link
Contributor

@tzaffi tzaffi commented Jun 3, 2022

Refactoring Cucumber Steps (V2 Only)

This PR is a NO-OP. Only code for testing is affected and the only changes amount to:

  • renaming a python file and creating new ones
  • moving code into new files
  • renaming some functions

Details

v2_steps.py has gotten ginormous, which makes it harder to work with.

The PR breaks up the file into:

  • test/steps/account_v2_steps.py - where most of the account-focused logic now resides
  • test/steps/application_v2_steps.py - where most of the app-centric logic now resides
  • test/steps/other_v2_steps.py - where miscellaneous other functionality including helper functions used by the other files resides

Testing

All tests should continue passing

from algosdk import account, encoding, logic
from algosdk.future import transaction

import test.steps.other_v2_steps
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is required to make MaybeString and MaybeBool which are defined in other_v2_steps available

Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

import test.steps.other_v2_steps


def fund_account_address(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move most helper functions to the top of the file

from test.steps.other_v2_steps import read_program


def operation_string_to_enum(operation):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move most helper functions to the top of the file

@@ -67,6 +57,52 @@ def parse_bool(value):
register_type(MaybeBool=parse_bool)


def validate_error(context, err):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move most helper functions to the top of the file

@tzaffi tzaffi merged commit 4d5e10b into develop Jun 3, 2022
@tzaffi tzaffi deleted the refactor-v2-steps branch June 3, 2022 13:58
@onetechnical onetechnical changed the title break v2_step.py into account_, application_, and other_ Break v2_step.py into account_, application_, and other_ Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants