From 7505938acc83a59298ad0133ca1f621adbbf6984 Mon Sep 17 00:00:00 2001 From: Mike Shoup Date: Wed, 3 Jul 2019 19:40:54 -0600 Subject: [PATCH] Update tests for FG/OG --- tests/conftest.py | 118 +++++++++++++++++++++++++++++++----------- tests/test_filters.py | 6 ++- 2 files changed, 91 insertions(+), 33 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1176a1b..f1fef06 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -158,62 +158,118 @@ def auth(client): def sample_recipes(): """These sample recipes are useful for testing filters.""" return { - 'blonde-ale': { - 'efficiency': '68.00', + 'lager': { + 'efficiency': '72', 'fermentables': [ { - 'amount': '8.50', + 'amount': '9.5', 'color': '1.80', 'name': 'Pale Malt, 2-row (Rahr) (US)', 'ppg': '37.00', 'type': 'Grain' }, { - 'amount': '0.50', - 'color': '10.00', - 'name': 'Munich Malt 10L (Briess) (US)', - 'ppg': '35.00', - 'type': 'Grain' + 'amount': '1', + 'color': '0', + 'name': 'Corn Sugar (Dextrose)', + 'ppg': '46.00', + 'type': 'Sugar' } ], 'hops': [ { - 'alpha': '9.30', - 'amount': '0.50', - 'duration': '30.00', - 'name': 'Cascade (US)', + 'alpha': '7.0', + 'amount': '1', + 'duration': '60', + 'name': 'Cluster (US)', 'use': 'Boil' }, { - 'alpha': '9.30', - 'amount': '0.50', - 'duration': '15.00', - 'name': 'Cascade (US)', + 'alpha': '2.8', + 'amount': '1', + 'duration': '10.00', + 'name': 'Saaz (CZ)', 'use': 'Boil' }, { - 'alpha': '9.30', - 'amount': '1.00', - 'duration': '5.00', - 'name': 'Cascade (US)', - 'use': 'Boil' + 'alpha': '2.8', + 'amount': '1.0', + 'duration': '5', + 'name': 'Saaz (CZ)', + 'use': 'Dry-Hop' } ], - 'name': 'Blonde Ale Base', - 'notes': "This is a base recipe. It's okay on its own, but" - 'better with other things, like fruits.', + 'name': 'Lager', + 'notes': 'Test simple dry-hopped lager w/ sugar', 'volume': '5.50', 'yeast': { 'abv_tolerance': '15.00', - 'code': 'WLP090', - 'flocculation': 'High', - 'high_attenuation': '83.00', + 'code': 'WLP940', + 'flocculation': 'Medium', + 'high_attenuation': '78.00', 'lab': 'White Labs', - 'low_attenuation': '76.00', - 'max_temperature': '68.00', - 'min_temperature': '65.00', - 'name': 'San Diego Super Yeast', + 'low_attenuation': '70.00', + 'max_temperature': '55.00', + 'min_temperature': '50.00', + 'name': 'Mexican Lager', 'type': 'Liquid' } + }, + 'sweetstout': { + 'efficiency': '72', + 'fermentables': [ + { + 'amount': '2.75', + 'color': '3', + 'name': 'Pale Malt, 2-row (UK)', + 'ppg': '36.00', + 'type': 'Grain' + }, + { + 'amount': '0.25', + 'color': '450', + 'name': 'Chocolate Malt (UK)', + 'ppg': '34.00', + 'type': 'Grain' + }, + { + 'amount': '0.5', + 'color': '0', + 'name': 'Lactose', + 'ppg': '35.00', + 'type': 'Non-fermentable' + } + ], + 'hops': [ + { + 'alpha': '5.0', + 'amount': '0.5', + 'duration': '60', + 'name': 'East Kent Goldings (UK)', + 'use': 'Boil' + }, + { + 'alpha': '5.0', + 'amount': '0.5', + 'duration': '10', + 'name': 'East Kent Goldings (UK)', + 'use': 'Boil' + } + ], + 'name': 'Sweet Stout', + 'notes': 'Test stout w/ Lactose', + 'volume': '2.5', + 'yeast': { + 'abv_tolerance': '12.00', + 'code': '', + 'flocculation': 'High', + 'high_attenuation': '77.00', + 'lab': 'Danstar', + 'low_attenuation': '73.00', + 'max_temperature': '70.00', + 'min_temperature': '57.00', + 'name': 'Nottingham', + 'type': 'Dry' + } } } diff --git a/tests/test_filters.py b/tests/test_filters.py index 71fa9fa..3f10516 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -17,8 +17,10 @@ from humulus.filters import * def test_recipe_og(sample_recipes): - assert recipe_og(sample_recipes['blonde-ale']) == '1.041' + assert recipe_og(sample_recipes['lager']) == '1.054' + assert recipe_og(sample_recipes['sweetstout']) == '1.038' def test_recipe_fg(sample_recipes): - assert recipe_fg(sample_recipes['blonde-ale']) == '1.008' + assert recipe_fg(sample_recipes['lager']) == '1.014' + assert recipe_fg(sample_recipes['sweetstout']) == '1.015'