We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
test_fuel correct code import pytest from fuel import convert, gauge
def test_convert_valid_fraction(): assert convert("3/4") == 75
def test_convert_zero_division_error(): with pytest.raises(ZeroDivisionError): convert("1/0")
def test_convert_value_error(): with pytest.raises(ValueError): convert("2.5/3")
def test_convert_x_greater_than_y(): with pytest.raises(ValueError): convert("5/3")
def test_gauge_less_than_1(): assert gauge(1) == "E" assert gauge(0) == "E"
def test_gauge_greater_than_99(): assert gauge(99) == "F" assert gauge(100) == "F"
def test_gauge_between_1_and_99(): assert gauge(50) == "50%" assert gauge(75) == "75%"
if name == "main": pytest.main()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
test_fuel
correct code
import pytest
from fuel import convert, gauge
Test cases for convert function
def test_convert_valid_fraction():
assert convert("3/4") == 75
def test_convert_zero_division_error():
with pytest.raises(ZeroDivisionError):
convert("1/0")
def test_convert_value_error():
with pytest.raises(ValueError):
convert("2.5/3")
def test_convert_x_greater_than_y():
with pytest.raises(ValueError):
convert("5/3")
Test cases for gauge function
def test_gauge_less_than_1():
assert gauge(1) == "E"
assert gauge(0) == "E"
def test_gauge_greater_than_99():
assert gauge(99) == "F"
assert gauge(100) == "F"
def test_gauge_between_1_and_99():
assert gauge(50) == "50%"
assert gauge(75) == "75%"
Additional test cases as needed
Run the tests with pytest
if name == "main":
pytest.main()
The text was updated successfully, but these errors were encountered: