Beispiel #1
0
    def test_has_edge():
        """Test that the right edges exist."""
        carb = AtomSpec('C')
        hyd = AtomSpec('H')

        atoms = [carb, hyd, hyd, carb, hyd]
        bonds = [
            BondSpec(0, 1, 1),
            BondSpec(0, 2, 1),
            BondSpec(0, 3, 2),
            BondSpec(3, 4, 1),
        ]

        molecule = Molecule(atoms, bonds)
        assert molecule.has_edge(0, 3)
Beispiel #2
0
 def test_has_edge():
     """Test that ``has_edge`` returns the correct result."""
     molecule = Molecule([], [])
     with pytest.raises(ValueError):
         molecule.has_edge(0, 1)