1
0
Fork 0
mirror of https://github.com/shouptech/humulus.git synced 2026-02-03 16:09:44 +00:00

Update tests for FG/OG

This commit is contained in:
Emma 2019-07-03 19:40:54 -06:00
parent 1ff3d6e3a7
commit 7505938acc
2 changed files with 91 additions and 33 deletions

View file

@ -158,62 +158,118 @@ def auth(client):
def sample_recipes(): def sample_recipes():
"""These sample recipes are useful for testing filters.""" """These sample recipes are useful for testing filters."""
return { return {
'blonde-ale': { 'lager': {
'efficiency': '68.00', 'efficiency': '72',
'fermentables': [ 'fermentables': [
{ {
'amount': '8.50', 'amount': '9.5',
'color': '1.80', 'color': '1.80',
'name': 'Pale Malt, 2-row (Rahr) (US)', 'name': 'Pale Malt, 2-row (Rahr) (US)',
'ppg': '37.00', 'ppg': '37.00',
'type': 'Grain' 'type': 'Grain'
}, },
{ {
'amount': '0.50', 'amount': '1',
'color': '10.00', 'color': '0',
'name': 'Munich Malt 10L (Briess) (US)', 'name': 'Corn Sugar (Dextrose)',
'ppg': '35.00', 'ppg': '46.00',
'type': 'Grain' 'type': 'Sugar'
} }
], ],
'hops': [ 'hops': [
{ {
'alpha': '9.30', 'alpha': '7.0',
'amount': '0.50', 'amount': '1',
'duration': '30.00', 'duration': '60',
'name': 'Cascade (US)', 'name': 'Cluster (US)',
'use': 'Boil' 'use': 'Boil'
}, },
{ {
'alpha': '9.30', 'alpha': '2.8',
'amount': '0.50', 'amount': '1',
'duration': '15.00', 'duration': '10.00',
'name': 'Cascade (US)', 'name': 'Saaz (CZ)',
'use': 'Boil' 'use': 'Boil'
}, },
{ {
'alpha': '9.30', 'alpha': '2.8',
'amount': '1.00', 'amount': '1.0',
'duration': '5.00', 'duration': '5',
'name': 'Cascade (US)', 'name': 'Saaz (CZ)',
'use': 'Boil' 'use': 'Dry-Hop'
} }
], ],
'name': 'Blonde Ale Base', 'name': 'Lager',
'notes': "This is a base recipe. It's okay on its own, but" 'notes': 'Test simple dry-hopped lager w/ sugar',
'better with other things, like fruits.',
'volume': '5.50', 'volume': '5.50',
'yeast': { 'yeast': {
'abv_tolerance': '15.00', 'abv_tolerance': '15.00',
'code': 'WLP090', 'code': 'WLP940',
'flocculation': 'High', 'flocculation': 'Medium',
'high_attenuation': '83.00', 'high_attenuation': '78.00',
'lab': 'White Labs', 'lab': 'White Labs',
'low_attenuation': '76.00', 'low_attenuation': '70.00',
'max_temperature': '68.00', 'max_temperature': '55.00',
'min_temperature': '65.00', 'min_temperature': '50.00',
'name': 'San Diego Super Yeast', 'name': 'Mexican Lager',
'type': 'Liquid' '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'
}
} }
} }

View file

@ -17,8 +17,10 @@ from humulus.filters import *
def test_recipe_og(sample_recipes): 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): 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'