コード例 #1
0
    def test_cross_passes_kwargs_to_mpl(self):
        axes = MagicMock()
        painter = MplPainter(axes)
        x, y, half_width = 1, 2, 0.1
        alpha = 0.8

        painter.cross(x, y, half_width, alpha=alpha)

        axes.add_patch.assert_called_once()
        self._verify_patch(patch=axes.add_patch.call_args[0][0], nvertices=4, alpha=alpha)
コード例 #2
0
    def test_cross_draws_with_only_xy(self):
        axes = MagicMock()
        painter = MplPainter(axes)
        x, y, half_width = 1, 2, 0.1

        artist = painter.cross(x, y, half_width)

        axes.add_patch.assert_called_once()
        self.assertTrue(artist is not None)
        self._verify_patch(patch=axes.add_patch.call_args[0][0], nvertices=4, alpha=None)