Пример #1
0
    def test_isotope_given_invalid():
        """
        Test that invalid atoms raise error when calling isotope.

        """
        carb = AtomSpec(6, 4)
        molecule = Molecule([carb], [])
        with pytest.raises(ValueError):
            molecule.isotope(1)
Пример #2
0
    def test_hyd_deut():
        """Test that isotopes are set correctly."""
        hyd = AtomSpec('H', isotope=1)
        deut = AtomSpec(1, isotope=2)

        molecule = Molecule([hyd, deut], [BondSpec(0, 1, 1)])
        assert molecule.isotope(0) == 1
        assert molecule.isotope(1) == 2