예제 #1
0
    def test_not_main(self, mock_resolve):
        mock_resolve.return_value = self.data

        frequency.add_waterfall(self.ax, self.data, 'mode_kappa',
                                direction='x', main=False, invert=False)

        self.ax.scatter.assert_called_once()
        self.ax.set_xlabel.assert_not_called()
        self.ax.set_ylabel.assert_not_called()
        self.ax.set_xlim.assert_not_called()
        self.ax.set_ylim.assert_not_called()
        mock_resolve.assert_called_once()
예제 #2
0
    def test_default(self, mock_resolve):
        mock_resolve.return_value = self.data

        frequency.add_waterfall(self.ax, self.data, 'mode_kappa',
                                direction='x', main=True, invert=False)

        self.assertEqual(self.ax.scatter.call_count, 2)
        self.ax.set_xlabel.assert_called_once()
        self.ax.set_ylabel.assert_called_once()
        self.ax.set_xlim.assert_called_once_with(0, 999)
        self.ax.set_ylim.assert_called_once_with(11, 999)
        self.assertEqual(mock_resolve.call_count, 2)
예제 #3
0
 def setUpClass(cls):
     cls.d = {'frequency':   [[range(1000)]],
              'mode_kappa':  [[[[[range(1000,2000)]]]]],
              'temperature': [11],
              'meta':        {}}
     cls.fig, cls.ax = one()
     cls.ax = frequency.add_waterfall(cls.ax, cls.d, 'mode_kappa',
                                      direction='x', main=True, invert=True)
예제 #4
0
 def test_colour(self):
     colour = 'red'
     fig, ax = one()
     ax = frequency.add_waterfall(ax, self.d, 'mode_kappa', direction='x',
                                  main=True, colour=colour)
예제 #5
0
 def test_colours(self):
     cmap = mpl.cm.get_cmap('viridis')
     colours = cmap([0])
     fig, ax = one()
     ax = frequency.add_waterfall(ax, self.d, 'mode_kappa', direction='x',
                                  main=True, colour=colours)