コード例 #1
0
ファイル: test_molecule.py プロジェクト: thesketh/oxmol
    def test_hydrogens_given_invalid():
        """
        Test that invalid atoms raise error when calling hydrogens.

        """
        carb = AtomSpec(6, 4)
        molecule = Molecule([carb], [])
        with pytest.raises(ValueError):
            molecule.hydrogens(1)
コード例 #2
0
ファイル: test_molecule.py プロジェクト: thesketh/oxmol
 def test_hydrogens():
     """Test the number of virtual hydrogens."""
     molecule = Molecule([AtomSpec('C')], [])
     assert molecule.hydrogens(0) == 0
コード例 #3
0
ファイル: test_molecule.py プロジェクト: thesketh/oxmol
 def test_hydrogens():
     """Test the number of hydrogens."""
     molecule = Molecule([AtomSpec('C', 3, -1)], [])
     assert molecule.hydrogens(0) == 3