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()
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)
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)
def test_colour(self): colour = 'red' fig, ax = one() ax = frequency.add_waterfall(ax, self.d, 'mode_kappa', direction='x', main=True, colour=colour)
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)