def test_degree_expl(): """Test the degree, constructed with explicit H.""" carb = AtomSpec('C') hyd = AtomSpec('H') atoms = [carb, hyd, hyd, hyd, hyd] bonds = [ BondSpec(0, 1, 1), BondSpec(0, 2, 1), BondSpec(0, 3, 1), BondSpec(0, 4, 1), ] molecule = Molecule(atoms, bonds) assert molecule.degree(0) == 4
def test_degree(): """Test the degree.""" molecule = Molecule([AtomSpec('C', 4)], []) assert molecule.degree(0) == 0