def test_command_line_spec_data_file_list(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        for item in 'user6idd.dat APS_spec_data.dat 02_03_setup.dat'.split():
            sys.argv.append(self.abs_data_fname(item))
        specplot_gallery.main()

        self.assertTrue(
            os.path.exists(
                os.path.join(self.tempdir, specplot_gallery.MTIME_CACHE_FILE)))

        plotDir = os.path.join(self.tempdir, '2010', '11', 'APS_spec_data')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, 'APS_spec_data.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))

        plotDir = os.path.join(self.tempdir, '2013', '10', 'user6idd')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'user6idd.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))

        plotDir = os.path.join(self.tempdir, '2016', '02', '02_03_setup')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, '02_03_setup.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
    def test_command_line_spec_data_file_list(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        for item in 'user6idd.dat APS_spec_data.dat 02_03_setup.dat'.split():
            sys.argv.append(self.abs_data_fname(item))
        specplot_gallery.main()
 
        self.assertTrue(os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))
 
        plotDir = os.path.join(self.tempdir, '2010', '11', 'APS_spec_data')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'APS_spec_data.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
        # TODO: test the order of plots in the index.html
 
        plotDir = os.path.join(self.tempdir, '2013', '10', 'user6idd')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'user6idd.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
 
        plotDir = os.path.join(self.tempdir, '2016', '02', '02_03_setup')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, '02_03_setup.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
示例#3
0
    def test_command_line_spec_data_file_list(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        for item in 'user6idd.dat APS_spec_data.dat 02_03_setup.dat'.split():
            sys.argv.append(self.abs_data_fname(item))
        specplot_gallery.main()

        self.assertTrue(
            os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))

        plotDir = os.path.join(self.tempdir, '2010', '11', 'APS_spec_data')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, 'APS_spec_data.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
        # TODO: test the order of plots in the index.html

        plotDir = os.path.join(self.tempdir, '2013', '10', 'user6idd')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'user6idd.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))

        plotDir = os.path.join(self.tempdir, '2016', '02', '02_03_setup')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, '02_03_setup.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
 def test_command_line_NeXus_writer_1_3(self):
     sys.argv.append('-d')
     self.assertTrue(os.path.exists(self.tempdir))
     sys.argv.append(self.tempdir)
     sys.argv.append(self.abs_data_fname('writer_1_3.h5'))
     specplot_gallery.main()
     # this is HDF5 file, not SPEC, so not much content
     children = os.listdir(self.tempdir)
     self.assertEqual(len(children), 0)
示例#5
0
 def test_command_line_NeXus_writer_1_3(self):
     sys.argv.append('-d')
     self.assertTrue(os.path.exists(self.tempdir))
     sys.argv.append(self.tempdir)
     sys.argv.append(self.abs_data_fname('writer_1_3.h5'))
     specplot_gallery.main()
     children = os.listdir(self.tempdir)
     self.assertEqual(len(children), 1)
     self.assertEqual(children[0], 'specplot_files_processing.log')
 def test_command_line_NeXus_writer_1_3(self):
     sys.argv.append('-d')
     self.assertTrue(os.path.exists(self.tempdir))
     sys.argv.append(self.tempdir)
     sys.argv.append(self.abs_data_fname('writer_1_3.h5'))
     specplot_gallery.main()
     children = os.listdir(self.tempdir)
     self.assertEqual(len(children), 1)
     self.assertEqual(children[0], 'specplot_files_processing.log')
    def test_command_line_spec_data_file_list_reversed_chrological_issue_79(self):
        sys.argv.append('-r')
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('APS_spec_data.dat'))
        specplot_gallery.main()

        plotDir = os.path.join(self.tempdir, '2010', '11', 'APS_spec_data')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'APS_spec_data.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
    def test_command_line_spec_data_file_33bm_spec(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('33bm_spec.dat'))
        specplot_gallery.main()
        self.assertTrue(os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))
        # TODO: test contents of mtime_cache.txt?

        plotDir = os.path.join(self.tempdir, '2010', '06', '33bm_spec')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, '33bm_spec.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
    def test_command_line_spec_data_file_02_03_setup(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('02_03_setup.dat'))
        specplot_gallery.main()
 
        self.assertTrue(os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))
 
        plotDir = os.path.join(self.tempdir, '2016', '02', '02_03_setup')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, '02_03_setup.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
    def test_command_line_spec_data_file_list_reversed_chronological_issue_79(
            self):
        sys.argv.append('-r')
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('APS_spec_data.dat'))
        specplot_gallery.main()

        plotDir = os.path.join(self.tempdir, '2010', '11', 'APS_spec_data')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, 'APS_spec_data.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
示例#11
0
    def test_command_line_spec_data_file_33bm_spec(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('33bm_spec.dat'))
        specplot_gallery.main()
        self.assertTrue(
            os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))
        # TODO: test contents of mtime_cache.txt?

        plotDir = os.path.join(self.tempdir, '2010', '06', '33bm_spec')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, '33bm_spec.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
    def test_command_line_spec_data_file_user6idd(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('user6idd.dat'))
        specplot_gallery.main()
 
        self.assertTrue(os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))
 
        # S1 aborted, S2 all X,Y are 0,0
        plotDir = os.path.join(self.tempdir, '2013', '10', 'user6idd')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'user6idd.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
示例#13
0
    def test_command_line_spec_data_file_user6idd(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('user6idd.dat'))
        specplot_gallery.main()

        self.assertTrue(
            os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))

        # S1 aborted, S2 all X,Y are 0,0
        plotDir = os.path.join(self.tempdir, '2013', '10', 'user6idd')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'user6idd.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
示例#14
0
    def test_command_line_spec_data_file_02_03_setup(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('02_03_setup.dat'))
        specplot_gallery.main()

        self.assertTrue(
            os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))

        plotDir = os.path.join(self.tempdir, '2016', '02', '02_03_setup')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, '02_03_setup.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
    def test_command_line_spec_data_file_03_06_JanTest(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('03_06_JanTest.dat'))
        specplot_gallery.main()
 
        self.assertTrue(os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))
 
        # S1 aborted, S2 all X,Y are 0,0
        plotDir = os.path.join(self.tempdir, '2014', '03', '03_06_JanTest')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(os.path.exists(os.path.join(plotDir, '03_06_JanTest.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 's00001.png')))
        # TODO: #69: look for handling of scan 1
        self.assertFalse(os.path.exists(os.path.join(plotDir, 's1.png')))
示例#16
0
    def test_command_line_spec_data_file_03_06_JanTest(self):
        sys.argv.append('-d')
        self.assertTrue(os.path.exists(self.tempdir))
        sys.argv.append(self.tempdir)
        sys.argv.append(self.abs_data_fname('03_06_JanTest.dat'))
        specplot_gallery.main()

        self.assertTrue(
            os.path.exists(os.path.join(self.tempdir, 'mtime_cache.txt')))

        # S1 aborted, S2 all X,Y are 0,0
        plotDir = os.path.join(self.tempdir, '2014', '03', '03_06_JanTest')
        self.assertTrue(os.path.exists(plotDir))
        self.assertTrue(
            os.path.exists(os.path.join(plotDir, '03_06_JanTest.dat')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 'index.html')))
        self.assertTrue(os.path.exists(os.path.join(plotDir, 's00001.png')))
        # TODO: #69: look for handling of scan 1
        self.assertFalse(os.path.exists(os.path.join(plotDir, 's1.png')))