Skip to content

Commit

Permalink
Minor edits (#79)
Browse files Browse the repository at this point in the history
* fix : GRIND_WARNING_MESSAGE updated

* fix : --water argument help updated

* fix : tests updated

* fix : tests updated
  • Loading branch information
sepandhaghighi authored Jan 11, 2025
1 parent 09d7ffc commit 8b4b544
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mycoffee/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main():
parser.add_argument('--info', help='information about the brewing method', type=str)
parser.add_argument('--coffee-ratio', help='coefficient for the coffee component in the ratio', type=float)
parser.add_argument('--water-ratio', help='coefficient for the water component in the ratio', type=float)
parser.add_argument('--water', help='amount of water in each cup (gr)', type=float)
parser.add_argument('--water', help='amount of water in each cup', type=float)
parser.add_argument('--cups', help='number of cups', type=int)
parser.add_argument('--grind', help='grind size (um)', type=int)
parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion mycoffee/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
MY_COFFEE_VERSION = "1.1"
INPUT_ERROR_MESSAGE = "[Error] Wrong input"
RATIO_WARNING_MESSAGE = "[Warning] The ratio is not within the standard range. For `{0}`, the ratio can be anywhere between `{1}` and `{2}`"
GRIND_WARNING_MESSAGE = "[Warning] The grind is not within the standard range. For `{0}`, the grind can be anywhere between `{1}` and `{2}`"
GRIND_WARNING_MESSAGE = "[Warning] The grind size is not within the standard range. For `{0}`, the grind size can be anywhere between `{1} um` and `{2} um`"
INPUT_EXAMPLE = "Example: mycoffee --method=v60"
EXIT_MESSAGE = "See you. Bye!"
EMPTY_INFO = "Nothing :)"
Expand Down
8 changes: 5 additions & 3 deletions test/functions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
>>> test_params = filter_params(test_params)
>>> check_ratio_limits(test_params) == False
True
>>> check_grind_limits(test_params) == False
True
>>> print_result(test_params)
__ __ _ _ ___ _____ ____ ____ ____ ____
( \/ )( \/ ) / __)( _ )( ___)( ___)( ___)( ___)
Expand All @@ -150,7 +152,7 @@
Info: Nothing :)
<BLANKLINE>
[Warning] The ratio is not within the standard range. For `v60`, the ratio can be anywhere between `1/18` and `1/14`
[Warning] The grind is not within the standard range. For `v60`, the grind can be anywhere between `400` and `700`
[Warning] The grind size is not within the standard range. For `v60`, the grind size can be anywhere between `400 um` and `700 um`
>>> test_params = {"method":"v60", "cups":2, "coffee":27.7, "water":500, "coffee_ratio": 1, "water_ratio":18, "info":"", "digits":3, "coffee_unit": "g", "water_unit": "g", "grind": 20}
>>> test_params = filter_params(test_params)
>>> check_ratio_limits(test_params) == False
Expand Down Expand Up @@ -180,7 +182,7 @@
Info: Nothing :)
<BLANKLINE>
[Warning] The ratio is not within the standard range. For `v60`, the ratio can be anywhere between `1/18` and `1/14`
[Warning] The grind is not within the standard range. For `v60`, the grind can be anywhere between `400` and `700`
[Warning] The grind size is not within the standard range. For `v60`, the grind size can be anywhere between `400 um` and `700 um`
>>> test_params = {"method":"custom", "cups":2, "coffee":6.0, "water":500, "coffee_ratio": 6, "water_ratio":1000, "info":"", "digits":3, "coffee_unit": "g"}
>>> test_params = filter_params(test_params)
>>> check_ratio_limits(test_params) == True
Expand Down Expand Up @@ -295,7 +297,7 @@
>>> _ = parser.add_argument('--info', help='brewing method info', type=str)
>>> _ = parser.add_argument('--coffee-ratio', help='coffee ratio', type=float)
>>> _ = parser.add_argument('--water-ratio', help='water ratio', type=float)
>>> _ = parser.add_argument('--water', help='water(ml)', type=float)
>>> _ = parser.add_argument('--water', help='water', type=float)
>>> _ = parser.add_argument('--cups', help='number of cups', type=int)
>>> _ = parser.add_argument('--grind', help='grind size (um)', type=int)
>>> _ = parser.add_argument('--digits', help='number of digits up to which the result is rounded', type=int, default=3)
Expand Down

0 comments on commit 8b4b544

Please sign in to comment.