Пример #1
0
def test_volume_for_1mole_in_12molar_solution():
    actual = volume_from_solution(moles('1.00'), molarity('12.0'))
    expected = Measurement(Decimal('0.0833'), LITERS)
    assert expected == actual
Пример #2
0
def test_grams_for_12mole_tenth_liter_HCl():
    actual = grams_in_solution(molarity('12.0'), molar_mass('HCl'), liters('0.100'))
    expected = Measurement(Scinot('4.38x10^1'), GRAMS)
    assert expected == actual
Пример #3
0
def test_moles_in_25ml_12mol_solution():
    actual = moles_in_solution(molarity('12.0'), milli(liters('25.0')))
    assert Measurement(Decimal('0.300'), MOLES) == actual
Пример #4
0
def test_grams_for_tenth_mole_one_liter_K2CrO4():
    actual = grams_in_solution(molarity('0.1000'), molar_mass('K2CrO4'), liters('1.00'))
    assert Measurement(Decimal('19.4'), GRAMS) == actual
Пример #5
0
def test_molarity_invalid_unit_exception():
    with pytest.raises(InvalidUnitError):
        molarity(Measurement(Decimal('1.20'), 'g'), Measurement(Decimal('2.50'), 'L'))
Пример #6
0
def test_molarity_with_convienience_methods():
    actual = molarity(moles('1.20'), liters('2.50'))
    assert Measurement(Decimal('0.480'), MOLES/LITERS) == actual
Пример #7
0
def test_molarity_by_gram_measurement():
    actual = molarity(Measurement(Decimal('1.20'), 'mol'), Measurement(Decimal('2.50'), 'L'))
    expected = Measurement(Scinot('4.80x10^-1'), MOLES/LITERS)
    assert expected == actual
Пример #8
0
def test_molarity_by_grams():
    actual = molarity(Decimal('1.20'), Decimal('2.50'))
    assert Measurement(Decimal('0.480'), MOLES/LITERS) == actual