示例#1
0
    def testColor(self):
        ax = self.fig.gca()
        createPlot(ax)

        self.assertEqual(len(ax.lines), 2)
        self.assertTrue(ax.lines[0].get_color() in  ['black', 'k'])
        self.assertTrue(ax.lines[1].get_color() in  ['black', 'k'])
示例#2
0
    def testXValues(self):
        ax = self.fig.gca()
        createPlot(ax)

        self.assertEqual(len(ax.lines), 2)
        x = ax.lines[0]._x
        np.testing.assert_array_almost_equal(x, self.expected_x)
示例#3
0
    def testYValues(self):
        ax = self.fig.gca()
        createPlot(ax)

        self.assertEqual(len(ax.lines), 2)
        y1 = ax.lines[0]._y
        np.testing.assert_array_almost_equal(y1, self.expected_y1)
        y2 = ax.lines[1]._y
        np.testing.assert_array_almost_equal(y2, self.expected_y2)
示例#4
0
 def testLegendLocation(self):
     ax = self.fig.gca()
     createPlot(ax)
     self.assertIsNotNone(ax.get_legend())
     self.assertEqual(ax.get_legend()._get_loc(), 2)
示例#5
0
 def testGrid(self):
     ax = MagicMock()
     createPlot(ax)
     ax.grid.assert_called()
示例#6
0
 def testYLim(self):
     ax = self.fig.gca()
     createPlot(ax)
     self.assertEqual(ax.get_ylim(), (-1.5, 2.0))
示例#7
0
 def testTitle(self):
     ax = self.fig.gca()
     createPlot(ax)
     self.assertEqual("Zwei versetzte Sinussignale", ax.title._text)
示例#8
0
    def testAxisLabels(self):
        ax = self.fig.gca()
        createPlot(ax)

        self.assertEqual(ax.get_ylabel(), "Amplitude in mV")
        self.assertEqual(ax.get_xlabel(), "Zeit in us")
示例#9
0
 def testLinestyle(self):
     ax = self.fig.gca()
     createPlot(ax)
     self.assertEqual(len(ax.lines), 2)
     self.assertEqual(ax.lines[0].get_linestyle(), '-')
     self.assertEqual(ax.lines[1].get_linestyle(), '--')
示例#10
0
 def testLabels(self):
     ax = self.fig.gca()
     createPlot(ax)
     self.assertEqual(len(ax.lines), 2)
     self.assertEqual(ax.lines[0].get_label(), '2.63 MHz mit 0° Phasenverschiebung')
     self.assertEqual(ax.lines[1].get_label(), '2.63 MHz mit 35° Phasenverschiebung')