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

make_level.py custom levels #272

Open
benthayer opened this issue Aug 8, 2020 · 0 comments
Open

make_level.py custom levels #272

benthayer opened this issue Aug 8, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@benthayer
Copy link
Owner

A custom level looks something like this. It's not much different than a normal level, but they are used frequently for custom status messages and other things.

Having these automatically generated (as stubs) would help avoid confusion.

class Init(BasicLevel):
    def _setup(self):
        # Make sure we are not in a git repo
        file_operator = operations.get_operator()
        file_operator.destroy_repo()

    def post_setup(self):
        self.cat_file("post-setup.txt")

    def status(self):
        simulate_command("git status")

    def _test(self):
        # Check if we are in a git repo
        file_operator = operations.get_operator()
        return file_operator.repo_exists()

    def test_failed(self):
        default_fail_no_reset()

    def test_passed(self):
        self.cat_file("passed.txt")
@benthayer benthayer added the enhancement New feature or request label Aug 8, 2020
@benthayer benthayer added this to the 1.x milestone Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant