예제 #1
0
    def test_atom_every_field_set(self, full_atom_type, are_equivalent_atoms):
        atom = Atom(
            name="test_atom",
            label="test_label",
            position=[0.0, 0.0, 0.0],
            charge=1.5,
            mass=2.0,
            element=element_by_symbol("C"),
            atom_type=full_atom_type,
        )

        atom_copy = Atom.parse_raw(atom.json())
        assert are_equivalent_atoms(atom, atom_copy)
예제 #2
0
 def test_atom_to_json_loop(self, typed_ethane, are_equivalent_atoms):
     atoms_to_test = typed_ethane.sites
     for atom in atoms_to_test:
         atom_json = atom.json()
         atom_copy = Atom.parse_raw(atom_json)
         assert are_equivalent_atoms(atom, atom_copy)