[Python-modules-commits] [python-mplexporter] 133/135: Add a test case for the empty canvas patch

Wolfgang Borgert debacle at moszumanska.debian.org
Tue Sep 23 21:19:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-mplexporter.

commit 5ba9e1c6d046354e0a9ee9490d1251aaea84e6a9
Author: Yu Feng <rainwoodman at gmail.com>
Date:   Sun Sep 21 15:09:47 2014 -0700

    Add a test case for the empty canvas patch
---
 mplexporter/tests/test_basic.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/mplexporter/tests/test_basic.py b/mplexporter/tests/test_basic.py
index 1fc7d56..f038144 100644
--- a/mplexporter/tests/test_basic.py
+++ b/mplexporter/tests/test_basic.py
@@ -125,6 +125,23 @@ def test_path():
                          closing figure
                          """)
 
+def test_Figure():
+    """ if the fig is not associated with a canvas, FakeRenderer shall
+    not fail. """
+    fig = plt.Figure()
+    ax = fig.add_subplot(111)
+    ax.add_patch(plt.Circle((0, 0), 1))
+    ax.add_patch(plt.Rectangle((0, 0), 1, 2))
+
+    _assert_output_equal(fake_renderer_output(fig, FakeRenderer),
+                         """
+                         opening figure
+                         opening axes
+                         draw path with 25 vertices
+                         draw path with 4 vertices
+                         closing axes
+                         closing figure
+                         """)
 
 def test_multiaxes():
     fig, ax = plt.subplots(2)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mplexporter.git



More information about the Python-modules-commits mailing list