コード例 #1
0
ファイル: test_molecule.py プロジェクト: thesketh/oxmol
 def test_charge_methyl_carbocation():
     """Test the charge."""
     molecule = Molecule([AtomSpec('C', 3, 1)], [])
     assert molecule.charge(0) == 1
コード例 #2
0
ファイル: test_molecule.py プロジェクト: thesketh/oxmol
 def test_charge():
     """Test the charge."""
     molecule = Molecule([AtomSpec('C')], [])
     assert molecule.charge(0) == 0
コード例 #3
0
ファイル: test_molecule.py プロジェクト: thesketh/oxmol
 def test_charge_given_invalid():
     """Test that invalid atoms raise error when calling charge."""
     carb = AtomSpec(6, 4)
     molecule = Molecule([carb], [])
     with pytest.raises(ValueError):
         molecule.charge(1)