Skip to content

fixed test description #88

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

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion exercises/08.2-How-Much-The-Wedding-Costs/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@


# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌
print('Your wedding will cost $'+str(price)+' dollars')
print('Your wedding will cost '+str(price)+' dollars')
8 changes: 4 additions & 4 deletions exercises/08.2-How-Much-The-Wedding-Costs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def test_for_print(capsys):
regex2 = re.compile(r"elif\s*")
assert bool(regex2.search(content)) == True

@pytest.mark.it("Between 101 and 199 guests sould be priced 15,000")
@pytest.mark.it("Between 101 and 200 guests sould be priced 15,000")
def test__between_100_and_200(capsys, app):
with mock.patch('builtins.input', lambda x: 199):
with mock.patch('builtins.input', lambda x: 200):
app()
captured = capsys.readouterr()
price = 15000
assert "Your wedding will cost "+str(price)+" dollars\n" in captured.out

@pytest.mark.it("Between 100 and 51 guests sould be priced 10,000")
@pytest.mark.it("Between 51 and 100 guests sould be priced 10,000")
def test_between_101_and_51(capsys, app):
with mock.patch('builtins.input', lambda x: 100):
app()
Expand All @@ -35,7 +35,7 @@ def test_between_101_and_51(capsys, app):

@pytest.mark.it("Less than 50 guests sould be priced 4,000")
def test_less_than_50(capsys, app):
with mock.patch('builtins.input', lambda x: 49):
with mock.patch('builtins.input', lambda x: 50):
app()
captured = capsys.readouterr()
price = 4000
Expand Down