def test_proportion_of_formula_not_matching_capitalization(self): fuel = Composition( ("S", 0.11), ("CH4", 0.10) ) self.assertEqual(0.10, fuel.proportion_of_formula("Ch4"))
def test_proportion_of_formula_returns_0_when_nothing_found(self): fuel = Composition( ("S", 0.11), ("CH4", 0.10) ) self.assertEqual(0, fuel.proportion_of_formula("not_existing_formula"))
def test_proportion_of_formula(self): fuel = Composition( ("S", 0.11), ("CH4", 0.10) ) self.assertEqual(0.10, fuel.proportion_of_formula("CH4"))