Пример #1
0
 def test_init_with_zeolite_obj(self):
     tmp_goo = PerfectZeolite.make('GOO')
     z = PerfectZeolite.build_from_cif_with_labels('data/GOO.cif')
     my_zeotype = PerfectZeolite(z)
     print(os.getcwd())
     # tests inheritance
     self.assertIsInstance(my_zeotype, PerfectZeolite)
     self.assertIsInstance(my_zeotype, Atoms)
     # tests empty list attributes
     # tests corretly defined parameters
     self.assertEqual(my_zeotype._site_to_atom_indices,
                      z._site_to_atom_indices)
     self.assertEqual(my_zeotype._atom_indices_to_site,
                      z._atom_indices_to_site)
     self.assertEqual(my_zeotype.name, z.name)
     self.assertEqual(my_zeotype.parent_zeotype, my_zeotype)
     #tests atoms are there and behave the same
     self.assertCountEqual(my_zeotype.get_tags(), z.get_tags())
     self.assertCountEqual(my_zeotype.get_chemical_symbols(),
                           z.get_chemical_symbols())
     self.assertNotEqual(id(my_zeotype.parent_zeotype),
                         id(z.parent_zeotype))
     self.assertNotEqual(id(my_zeotype.index_mapper), id(z.index_mapper))
     self.assertNotEqual(id(my_zeotype.index_mapper), id(z.parent_zeotype))
     self.assertNotEqual(my_zeotype.index_mapper, None)
Пример #2
0
 def test_init_with_atoms_obj(self):
     tmp_goo = PerfectZeolite.make('GOO')
     my_atoms = read('data/GOO.cif')
     my_zeotype = PerfectZeolite(my_atoms)
     # tests inheritance
     self.assertIsInstance(my_zeotype, PerfectZeolite)
     self.assertIsInstance(my_zeotype, Atoms)
     # tests empty list attributes
     # tests corretly defined parameters
     self.assertEqual(my_zeotype._site_to_atom_indices, None)
     self.assertEqual(my_zeotype._atom_indices_to_site, None)
     self.assertEqual('parent', my_zeotype.name)
     self.assertEqual(my_zeotype.parent_zeotype, my_zeotype)
     #tests atoms are there and behave the same
     self.assertCountEqual(my_zeotype.get_tags(), my_atoms.get_tags())
     self.assertCountEqual(my_zeotype.get_chemical_symbols(),
                           my_atoms.get_chemical_symbols())