Esempio n. 1
0
 def test_charge_methyl_carbocation():
     """Test the charge."""
     molecule = Molecule([AtomSpec('C', 3, 1)], [])
     assert molecule.charge(0) == 1
Esempio n. 2
0
 def test_charge():
     """Test the charge."""
     molecule = Molecule([AtomSpec('C')], [])
     assert molecule.charge(0) == 0
Esempio n. 3
0
 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)