git-gud
git-gud copied to clipboard
`make_level.py` custom levels
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")