def test_command_line(self):
     tempdir = tempfile.mkdtemp()
     specFile = self.abs_data_fname('02_03_setup.dat')
     plotFile = os.path.join(tempdir, 'image.png')
     sys.argv = [sys.argv[0], specFile, '1', plotFile]
     specplot.main()
     self.assertTrue(os.path.exists(plotFile))
     shutil.rmtree(tempdir, ignore_errors=True)
     self.assertFalse(os.path.exists(plotFile))
Beispiel #2
0
 def test_command_line(self):
     tempdir = tempfile.mkdtemp()
     specFile = self.abs_data_fname('02_03_setup.dat')
     plotFile = os.path.join(tempdir, 'image.png')
     sys.argv = [sys.argv[0], specFile, '1', plotFile]
     specplot.main()
     self.assertTrue(os.path.exists(plotFile))
     shutil.rmtree(tempdir, ignore_errors=True)
     self.assertFalse(os.path.exists(plotFile))
    def test_command_line_33bm_spec_issue80_hklscan_plot(self):
        # #80: hklscan, l was scanned, scans 14 & 16
        tempdir = tempfile.mkdtemp()

        specFile = self.abs_data_fname('33bm_spec.dat')
        scan_number = 14  # hklmesh

        plotFile = os.path.join(tempdir, 'image.png')
        sys.argv = [sys.argv[0], specFile, str(scan_number), plotFile]

        specplot.main()

        self.assertTrue(os.path.exists(self.plotFile))
        shutil.rmtree(tempdir)
        self.assertFalse(os.path.exists(plotFile))
Beispiel #4
0
 def test_command_line_33bm_spec_issue80_hklscan_plot(self):
     # #80: hklscan, l was scanned, scans 14 & 16
     tempdir = tempfile.mkdtemp()
  
     specFile = self.abs_data_fname('33bm_spec.dat')
     scan_number = 14        # hklmesh
  
     plotFile = os.path.join(tempdir, 'image.png')
     sys.argv = [sys.argv[0], specFile, str(scan_number), plotFile]
  
     specplot.main()
  
     self.assertTrue(os.path.exists(self.plotFile))
     shutil.rmtree(tempdir)
     self.assertFalse(os.path.exists(plotFile))
    def test_command_line_33id_spec_issue72_mesh_plot(self):
        # mesh:    data/33id_spec.dat  scan 22
        # hklmesh: data/33bm_spec.dat  scan 17
        tempdir = tempfile.mkdtemp()

        specFile = self.abs_data_fname('33id_spec.dat')
        scan_number = 22  # mesh

        plotFile = os.path.join(tempdir, 'image.png')
        sys.argv = [sys.argv[0], specFile, str(scan_number), plotFile]

        specplot.main()

        self.assertTrue(os.path.exists(self.plotFile))
        shutil.rmtree(tempdir)
        self.assertFalse(os.path.exists(plotFile))
Beispiel #6
0
 def test_command_line_33id_spec_issue72_mesh_plot(self):
     # mesh:    data/33id_spec.dat  scan 22
     # hklmesh: data/33bm_spec.dat  scan 17
     tempdir = tempfile.mkdtemp()
   
     specFile = self.abs_data_fname('33id_spec.dat')
     scan_number = 22        # mesh
   
     plotFile = os.path.join(tempdir, 'image.png')
     sys.argv = [sys.argv[0], specFile, str(scan_number), plotFile]
   
     specplot.main()
   
     self.assertTrue(os.path.exists(self.plotFile))
     shutil.rmtree(tempdir)
     self.assertFalse(os.path.exists(plotFile))