Skip to content

Commit

Permalink
Tests/add new test case weight_conversion (#11468)
Browse files Browse the repository at this point in the history
* add new test

* add new test
  • Loading branch information
ShiryuReb committed Jun 26, 2024
1 parent 75b8667 commit 6882a8b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions conversions/weight_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ def weight_conversion(from_type: str, to_type: str, value: float) -> float:
1.660540199e-23
>>> weight_conversion("atomic-mass-unit","atomic-mass-unit",2)
1.999999998903455
>>> weight_conversion("slug", "kilogram", 1)
Traceback (most recent call last):
...
ValueError: Invalid 'from_type' or 'to_type' value: 'slug', 'kilogram'
Supported values are: kilogram, gram, milligram, metric-ton, long-ton, short-ton, \
pound, stone, ounce, carrat, atomic-mass-unit
"""
if to_type not in KILOGRAM_CHART or from_type not in WEIGHT_TYPE_CHART:
msg = (
Expand Down

0 comments on commit 6882a8b

Please sign in to comment.