Esempio n. 1
0
    def test_size():
        """Test that ``size`` is correct."""
        carb_3 = AtomSpec(6, 3)
        carb_1 = AtomSpec(6, 1)

        atoms = [carb_3, carb_1, carb_1, carb_3]
        bonds = [
            BondSpec(0, 1, BondOrder(1)),
            BondSpec(1, 2, BondOrder(2), True),
            BondSpec(2, 3, BondOrder(1)),
        ]

        molecule = Molecule(atoms, bonds)
        assert molecule.size() == 3
Esempio n. 2
0
 def test_size():
     """Test that ``size`` returns the correct result."""
     molecule = Molecule([], [])
     assert molecule.size() == 0
Esempio n. 3
0
 def test_size():
     """Test that methane's ``size`` is 0."""
     molecule = Molecule([AtomSpec('C', 4)], [])
     assert molecule.size() == 0