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

Update __init__.py #232

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion game/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ def test_string_guess():
check50.run("python3 game.py").stdin("1", prompt=True).stdin("cat", prompt=True).reject()


@check50.check(test_valid_level)
def test_zero_guess():
"""game.py rejects non-positive guess"""
check50.run("python3 game.py").stdin("1", prompt=True).stdin("0", prompt=True).reject()


@check50.check(test_valid_level)
def test_out_of_range_small():
"""game.py rejects guess below specified range with \"Too small!\""""
output = "Too small!"
check50.run("python3 game.py").stdin("1", prompt=True).stdin("0", prompt=True).stdout(regex(output), output, regex=True).reject()
check50.run("python3 game.py").stdin("2", prompt=True).stdin("1", prompt=True).stdout(regex(output), output, regex=True).reject()


@check50.check(test_valid_level)
Expand Down