Files
curriculum/1.solar-system/2.first-light/08.the-formatter/testing/test_solution.py

14 lines
380 B
Python

from solution import format_receipt
def test_basic():
assert format_receipt(9.99, 3) == "Item price: $9.99\nQuantity: 3\nTotal: $29.97"
def test_round_numbers():
assert format_receipt(100, 1) == "Item price: $100.00\nQuantity: 1\nTotal: $100.00"
def test_decimal_quantity_one():
assert format_receipt(1.5, 10) == "Item price: $1.50\nQuantity: 10\nTotal: $15.00"