示例#1
0
 def test_fail_invalid_infile(self):
     '''Failing due to invalid input file.'''
     tempname = common.get_temporary_filename(self.workroot)
     nonexisting_infile = os.path.join(self.workdir, tempname)
     outfile = self.get_output('h2o.gen')
     cmdargs = ['-o', outfile, nonexisting_infile]
     with self.assertRaises(ScriptError):
         xyz2gen.main(cmdargs)
示例#2
0
 def test_cluster(self):
     '''Absolute coordinates without external lattice vectors'''
     infile = self.get_input('h2o.234.xyz')
     reffile = self.get_input('h2o.234.gen')
     outfile = self.get_output('h2o.234.gen')
     cmdargs = ['-o', outfile, infile]
     xyz2gen.main(cmdargs)
     self.assertTrue(common.gen_file_equals(outfile, reffile))
示例#3
0
 def test_fraccoords_lattice(self):
     '''Fractional coordinates with external lattice vectors'''
     infile = self.get_input('gaas-frac.xyz')
     latticefile = self.get_input('gaas-frac.latvecs')
     reffile = self.get_input('gaas-frac.gen')
     outfile = self.get_output('gaas-frac.gen')
     cmdargs = ['-o', outfile, '-l', latticefile, '-f', infile]
     xyz2gen.main(cmdargs)
     self.assertTrue(common.gen_file_equals(outfile, reffile))
示例#4
0
 def test_periodicabs_lattice(self):
     '''Absolute coordinates with external lattice vectors'''
     infile = self.get_input('h2o.xyz')
     latticefile = self.get_input('h2o.latvecs')
     reffile = self.get_input('h2o.gen')
     outfile = self.get_output('h2o.gen')
     cmdargs = ['-l', latticefile, '-o', outfile, infile]
     xyz2gen.main(cmdargs)
     self.assertTrue(common.gen_file_equals(outfile, reffile))