Skip to content

Commit

Permalink
fix : verified_test.py updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Oct 3, 2024
1 parent 6da4f55 commit 55fcfa4
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions test/verified_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""
>>> from fractions import Fraction
>>> from mycoffee.functions import *
>>> from mycoffee.params import METHODS_MAP
>>> v60_params = load_method_params("v60") # https://www.origincoffee.co.uk/blogs/journal/brewing-at-home-v60
Expand All @@ -12,9 +13,9 @@
>>> v60_coffee = calc_coffee(v60_params)
>>> v60_coffee == 15
True
>>> METHODS_MAP["v60"]["ratio_upper_limit"] == 1/14
>>> METHODS_MAP["v60"]["ratio_upper_limit"] == Fraction(1, 14)
True
>>> METHODS_MAP["v60"]["ratio_lower_limit"] == 1/18
>>> METHODS_MAP["v60"]["ratio_lower_limit"] == Fraction(1, 18)
True
>>> chemex_params = load_method_params("chemex") # https://honestcoffeeguide.com/coffee-to-water-ratio-calculator
>>> chemex_params["coffee_ratio"] == 1
Expand All @@ -26,9 +27,9 @@
>>> chemex_coffee = calc_coffee(chemex_params)
>>> chemex_coffee == 16
True
>>> METHODS_MAP["chemex"]["ratio_upper_limit"] == 1/10
>>> METHODS_MAP["chemex"]["ratio_upper_limit"] == Fraction(1, 10)
True
>>> METHODS_MAP["chemex"]["ratio_lower_limit"] == 1/21
>>> METHODS_MAP["chemex"]["ratio_lower_limit"] == Fraction(1, 21)
True
>>> espresso_params = load_method_params("espresso") # https://honestcoffeeguide.com/coffee-to-water-ratio-calculator
>>> espresso_params["coffee_ratio"] == 1
Expand All @@ -40,9 +41,9 @@
>>> espresso_coffee = calc_coffee(espresso_params)
>>> espresso_coffee == 18
True
>>> METHODS_MAP["espresso"]["ratio_upper_limit"] == 1/1.5
>>> METHODS_MAP["espresso"]["ratio_upper_limit"] == Fraction(2, 3)
True
>>> METHODS_MAP["espresso"]["ratio_lower_limit"] == 1/2.5
>>> METHODS_MAP["espresso"]["ratio_lower_limit"] == Fraction(2, 5)
True
>>> siphon_params = load_method_params("siphon") # https://bluebottlecoffee.com/us/eng/brew-guides/siphon
>>> siphon_params["coffee_ratio"] == 1
Expand All @@ -54,9 +55,9 @@
>>> siphon_coffee = calc_coffee(siphon_params)
>>> siphon_coffee == 16
True
>>> METHODS_MAP["siphon"]["ratio_upper_limit"] == 1/12
>>> METHODS_MAP["siphon"]["ratio_upper_limit"] == Fraction(1, 12)
True
>>> METHODS_MAP["siphon"]["ratio_lower_limit"] == 1/16
>>> METHODS_MAP["siphon"]["ratio_lower_limit"] == Fraction(1, 16)
True
>>> french_press_params = load_method_params("french-press") # https://useandcares.hamiltonbeach.com/files/840230401.pdf
>>> french_press_params["coffee_ratio"] == 1
Expand All @@ -68,9 +69,9 @@
>>> french_press_coffee = calc_coffee(french_press_params)
>>> french_press_coffee == 8
True
>>> METHODS_MAP["french-press"]["ratio_upper_limit"] == 1/12
>>> METHODS_MAP["french-press"]["ratio_upper_limit"] == Fraction(1, 12)
True
>>> METHODS_MAP["french-press"]["ratio_lower_limit"] == 1/18
>>> METHODS_MAP["french-press"]["ratio_lower_limit"] == Fraction(1, 18)
True
>>> pour_over_params = load_method_params("pour-over") # https://www.nicolebattefeld.com/post/best-recipes-2022
>>> pour_over_params["coffee_ratio"] == 1
Expand All @@ -82,9 +83,9 @@
>>> pour_over_coffee = calc_coffee(pour_over_params)
>>> pour_over_coffee == 16
True
>>> METHODS_MAP["pour-over"]["ratio_upper_limit"] == 1/14
>>> METHODS_MAP["pour-over"]["ratio_upper_limit"] == Fraction(1, 14)
True
>>> METHODS_MAP["pour-over"]["ratio_lower_limit"] == 1/16
>>> METHODS_MAP["pour-over"]["ratio_lower_limit"] == Fraction(1, 16)
True
>>> auto_drip_params = load_method_params("auto-drip") # https://wonderstate.com/pages/auto-drip
>>> auto_drip_params["coffee_ratio"] == 1
Expand All @@ -96,9 +97,9 @@
>>> auto_drip_coffee = calc_coffee(auto_drip_params)
>>> auto_drip_coffee == 8
True
>>> METHODS_MAP["auto-drip"]["ratio_upper_limit"] == 1/14
>>> METHODS_MAP["auto-drip"]["ratio_upper_limit"] == Fraction(1, 14)
True
>>> METHODS_MAP["auto-drip"]["ratio_lower_limit"] == 1/17
>>> METHODS_MAP["auto-drip"]["ratio_lower_limit"] == Fraction(1, 17)
True
>>> cold_brew_params = load_method_params("cold-brew") # https://counterculturecoffee.com/blogs/counter-culture-coffee/guide-to-cold-brew
>>> cold_brew_params["coffee_ratio"] == 1
Expand All @@ -110,9 +111,9 @@
>>> cold_brew_coffee = calc_coffee(cold_brew_params)
>>> cold_brew_coffee == 22
True
>>> METHODS_MAP["cold-brew"]["ratio_upper_limit"] == 1/8
>>> METHODS_MAP["cold-brew"]["ratio_upper_limit"] == Fraction(1, 8)
True
>>> METHODS_MAP["cold-brew"]["ratio_lower_limit"] == 1/15
>>> METHODS_MAP["cold-brew"]["ratio_lower_limit"] == Fraction(1, 15)
True
>>> cold_brew_conc_params = load_method_params("cold-brew-conc") # https://www.thespruceeats.com/cold-brew-concentrate-recipe-5197494
>>> cold_brew_conc_params["coffee_ratio"] == 1
Expand All @@ -124,9 +125,9 @@
>>> cold_brew_conc_coffee = calc_coffee(cold_brew_conc_params)
>>> cold_brew_conc_coffee == 24
True
>>> METHODS_MAP["cold-brew-conc"]["ratio_upper_limit"] == 1/4
>>> METHODS_MAP["cold-brew-conc"]["ratio_upper_limit"] == Fraction(1, 4)
True
>>> METHODS_MAP["cold-brew-conc"]["ratio_lower_limit"] == 1/6
>>> METHODS_MAP["cold-brew-conc"]["ratio_lower_limit"] == Fraction(1, 6)
True
>>> moka_pot_params = load_method_params("moka-pot") # https://bakedbrewedbeautiful.com/how-to-make-coffee-in-moka-pot
>>> moka_pot_params["coffee_ratio"] == 1
Expand All @@ -138,9 +139,9 @@
>>> moka_pot_coffee = calc_coffee(moka_pot_params)
>>> moka_pot_coffee == 6
True
>>> METHODS_MAP["moka-pot"]["ratio_upper_limit"] == 1/7
>>> METHODS_MAP["moka-pot"]["ratio_upper_limit"] == Fraction(1, 7)
True
>>> METHODS_MAP["moka-pot"]["ratio_lower_limit"] == 1/12
>>> METHODS_MAP["moka-pot"]["ratio_lower_limit"] == Fraction(1, 12)
True
>>> ristretto_params = load_method_params("ristretto") # https://honestcoffeeguide.com/coffee-to-water-ratio-calculator
>>> ristretto_params["coffee_ratio"] == 1
Expand All @@ -152,9 +153,9 @@
>>> ristretto_coffee = calc_coffee(ristretto_params)
>>> ristretto_coffee == 18
True
>>> METHODS_MAP["ristretto"]["ratio_upper_limit"] == 1/1
>>> METHODS_MAP["ristretto"]["ratio_upper_limit"] == Fraction(1, 1)
True
>>> METHODS_MAP["ristretto"]["ratio_lower_limit"] == 1/1.5
>>> METHODS_MAP["ristretto"]["ratio_lower_limit"] == Fraction(2, 3)
True
>>> lungo_params = load_method_params("lungo") # https://honestcoffeeguide.com/coffee-to-water-ratio-calculator
>>> lungo_params["coffee_ratio"] == 1
Expand All @@ -166,9 +167,9 @@
>>> lungo_coffee = calc_coffee(lungo_params)
>>> lungo_coffee == 18
True
>>> METHODS_MAP["lungo"]["ratio_upper_limit"] == 1/2.5
>>> METHODS_MAP["lungo"]["ratio_upper_limit"] == Fraction(2, 5)
True
>>> METHODS_MAP["lungo"]["ratio_lower_limit"] == 1/4
>>> METHODS_MAP["lungo"]["ratio_lower_limit"] == Fraction(1, 4)
True
>>> turkish_params = load_method_params("turkish") # https://www.drinktrade.com/blogs/education/how-to-make-turkish-coffee
>>> turkish_params["coffee_ratio"] == 1
Expand All @@ -180,9 +181,9 @@
>>> turkish_coffee = calc_coffee(turkish_params)
>>> turkish_coffee == 5
True
>>> METHODS_MAP["turkish"]["ratio_upper_limit"] == 1/8
>>> METHODS_MAP["turkish"]["ratio_upper_limit"] == Fraction(1, 8)
True
>>> METHODS_MAP["turkish"]["ratio_lower_limit"] == 1/12
>>> METHODS_MAP["turkish"]["ratio_lower_limit"] == Fraction(1, 12)
True
>>> cupping_params = load_method_params("cupping") # https://www.horshamcoffeeroaster.co.uk/pages/how-to-cup-coffee
>>> cupping_params["coffee_ratio"] == 11
Expand All @@ -194,9 +195,9 @@
>>> cupping_coffee = calc_coffee(cupping_params)
>>> cupping_coffee == 8.25
True
>>> METHODS_MAP["cupping"]["ratio_upper_limit"] == 1/17
>>> METHODS_MAP["cupping"]["ratio_upper_limit"] == Fraction(1, 17)
True
>>> METHODS_MAP["cupping"]["ratio_lower_limit"] == 1/19
>>> METHODS_MAP["cupping"]["ratio_lower_limit"] == Fraction(1, 19)
True
>>> aero_press_params = load_method_params("aero-press") # https://aeroprecipe.com/recipes/tetsu-kasuya-aeropress-recipe
>>> aero_press_params["coffee_ratio"] == 1
Expand All @@ -208,9 +209,9 @@
>>> aero_press_coffee = calc_coffee(aero_press_params)
>>> aero_press_coffee == 9
True
>>> METHODS_MAP["aero-press"]["ratio_upper_limit"] == 1/12
>>> METHODS_MAP["aero-press"]["ratio_upper_limit"] == Fraction(1, 12)
True
>>> METHODS_MAP["aero-press"]["ratio_lower_limit"] == 1/18
>>> METHODS_MAP["aero-press"]["ratio_lower_limit"] == Fraction(1, 18)
True
>>> aero_press_conc_params = load_method_params("aero-press-conc") # https://www.seattlecoffeegear.com/pages/product-resource/aero-press-product-resources
>>> aero_press_conc_params["coffee_ratio"] == 1
Expand All @@ -222,9 +223,9 @@
>>> aero_press_conc_coffee = calc_coffee(aero_press_conc_params)
>>> aero_press_conc_coffee == 15
True
>>> METHODS_MAP["aero-press-conc"]["ratio_upper_limit"] == 1/5
>>> METHODS_MAP["aero-press-conc"]["ratio_upper_limit"] == Fraction(1, 5)
True
>>> METHODS_MAP["aero-press-conc"]["ratio_lower_limit"] == 1/7
>>> METHODS_MAP["aero-press-conc"]["ratio_lower_limit"] == Fraction(1, 7)
True
>>> aero_press_inv_params = load_method_params("aero-press-inv") # https://aeroprecipe.com/recipes/all-about-the-intervals
>>> aero_press_inv_params["coffee_ratio"] == 1
Expand All @@ -236,9 +237,9 @@
>>> aero_press_inv_coffee = calc_coffee(aero_press_inv_params)
>>> aero_press_inv_coffee == 11
True
>>> METHODS_MAP["aero-press-inv"]["ratio_upper_limit"] == 1/10
>>> METHODS_MAP["aero-press-inv"]["ratio_upper_limit"] == Fraction(1, 10)
True
>>> METHODS_MAP["aero-press-inv"]["ratio_lower_limit"] == 1/14
>>> METHODS_MAP["aero-press-inv"]["ratio_lower_limit"] == Fraction(1, 14)
True
>>> steep_and_release_params = load_method_params("steep-and-release") # https://squaremileblog.com/brew-guide-clever-dripper/
>>> steep_and_release_params["coffee_ratio"] == 1
Expand All @@ -250,8 +251,8 @@
>>> steep_and_release_coffee = calc_coffee(steep_and_release_params)
>>> steep_and_release_coffee == 15.9375
True
>>> METHODS_MAP["steep-and-release"]["ratio_upper_limit"] == 1/14
>>> METHODS_MAP["steep-and-release"]["ratio_upper_limit"] == Fraction(1, 14)
True
>>> METHODS_MAP["steep-and-release"]["ratio_lower_limit"] == 1/17
>>> METHODS_MAP["steep-and-release"]["ratio_lower_limit"] == Fraction(1, 17)
True
"""

0 comments on commit 55fcfa4

Please sign in to comment.