def test_write_cif_PIYZAZ(): """ Tests writing cif formatted molecule file File comparison tests are OS dependent, they should only work in UNIX but not Windows. """ piyzaz = Molecule(atoms=piyzaz_atoms, coordinates=piyzaz_coors) test_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'piyzaz_test.cif') piyzaz.write(test_file, cell=piyzaz_cell_parameters, header='piyzaz') assert filecmp.cmp(piyzaz_cif, test_file) os.remove(test_file)
def test_write_pdb_benzene_molecule_with_bonds(): """ Tests writing pdb formatted molecule file with bonds. File comparison tests are OS dependent, they should only work in UNIX but not Windows. """ benzene = Molecule(atoms=benzene_atoms, coordinates=benzene_coors) test_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'benzene_bonds_test.pdb') benzene.write(test_file, bonds=True, header='benzene') assert filecmp.cmp(benzene_bonds_pdb, test_file) os.remove(test_file)
def test_write_xyz_benzene_molecule(): """ Tests reading xyz formatted molecule file. File comparison tests are OS dependent, they should only work in UNIX but not Windows. """ benzene = Molecule(atoms=benzene_atoms, coordinates=benzene_coors) test_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'benzene_test.xyz') benzene.write(test_file, header='benzene') assert filecmp.cmp(benzene_xyz, test_file) os.remove(test_file)