Beispiel #1
0
 def test_convert_to_cereal_raises(self):
     grain_add = GrainAddition(pale_lme,
                               weight=1.0,
                               grain_type=GRAIN_TYPE_LME)
     with self.assertRaises(GrainException) as ctx:
         grain_add.convert_to_cereal(brew_house_yield=BHY)
     self.assertEquals(str(ctx.exception),
                       u'Must provide PPG to convert to cereal')
Beispiel #2
0
    def test_convert_to_dme(self):
        grain_add = GrainAddition(pale_dme,
                                  weight=1.0,
                                  grain_type=GRAIN_TYPE_DME)
        ga_cereal = grain_add.convert_to_cereal(ppg=ppg_pale,
                                                brew_house_yield=BHY)
        ga_lme = grain_add.convert_to_lme(ppg=PPG_LME, brew_house_yield=BHY)
        ga_dme = grain_add.convert_to_dme(ppg=PPG_DME, brew_house_yield=BHY)

        self.assertEquals(round(ga_cereal.weight, 2), 1.7)
        self.assertEquals(round(ga_lme.weight, 2), 1.22)
        self.assertEquals(ga_dme.weight, 1.0)