コード例 #1
0
ファイル: qualctrl_tests.py プロジェクト: pysmo/aimbat
        def test_sortButtonWorks(self):
            sys.argv[1:] = [test_filename]
            gsac, opts = getDataOpts()
            axs = getAxes(opts)
            ppmm = PickPhaseMenuMore(gsac, opts, axs)

            # get files before sorting
            unsortedFiles = []
            for sacdh in gsac.selist:
                unsortedFiles.append(sacdh.filename)

            # click the sort button
            event_clickSortBtn = matplotlib.backend_bases.MouseEvent('button_press_event', ppmm.axstk.figure.canvas, 62, 295)
            ppmm.sorting(event_clickSortBtn)

            # click sort filename button
            event_clickSortFilenameBtn = matplotlib.backend_bases.MouseEvent('button_press_event', ppmm.figsort.canvas, 151, 700)
            ppmm.sort_file(event_clickSortFilenameBtn)

            # get files after sorting
            sortedFiles = []
            for sacdh in gsac.selist:
                sortedFiles.append(sacdh.filename)
            
            self.assertNotEqual(unsortedFiles, sortedFiles)
コード例 #2
0
        def test_sortButtonWorks(self):
            sys.argv[1:] = [test_filename]
            gsac, opts = getDataOpts()
            axs = getAxes(opts)
            ppmm = PickPhaseMenuMore(gsac, opts, axs)

            # get files before sorting
            unsortedFiles = []
            for sacdh in gsac.selist:
                unsortedFiles.append(sacdh.filename)

            # click the sort button
            event_clickSortBtn = matplotlib.backend_bases.MouseEvent(
                'button_press_event', ppmm.axstk.figure.canvas, 62, 295)
            ppmm.sorting(event_clickSortBtn)

            # click sort filename button
            event_clickSortFilenameBtn = matplotlib.backend_bases.MouseEvent(
                'button_press_event', ppmm.figsort.canvas, 151, 700)
            ppmm.sort_file(event_clickSortFilenameBtn)

            # get files after sorting
            sortedFiles = []
            for sacdh in gsac.selist:
                sortedFiles.append(sacdh.filename)

            self.assertNotEqual(unsortedFiles, sortedFiles)
コード例 #3
0
ファイル: qualctrl_tests.py プロジェクト: pysmo/aimbat
        def test_sortFigExists(self):
            sys.argv[1:] = [test_filename]
            gsac, opts = getDataOpts()
            axs = getAxes(opts)
            ppmm = PickPhaseMenuMore(gsac, opts, axs)

            self.assertFalse(hasattr(ppmm,'figsort'))

            fake_event = matplotlib.backend_bases.MouseEvent('button_press_event', ppmm.axstk.figure.canvas, 62, 295)
            ppmm.sorting(fake_event)

            self.assertIsNotNone(ppmm.figsort)
            self.assertIsNotNone(ppmm.sortAxs)
コード例 #4
0
        def test_sortFigExists(self):
            sys.argv[1:] = [test_filename]
            gsac, opts = getDataOpts()
            axs = getAxes(opts)
            ppmm = PickPhaseMenuMore(gsac, opts, axs)

            self.assertFalse(hasattr(ppmm, 'figsort'))

            fake_event = matplotlib.backend_bases.MouseEvent(
                'button_press_event', ppmm.axstk.figure.canvas, 62, 295)
            ppmm.sorting(fake_event)

            self.assertIsNotNone(ppmm.figsort)
            self.assertIsNotNone(ppmm.sortAxs)