From: <as...@us...> - 2009-09-07 20:03:23
|
Revision: 7687 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7687&view=rev Author: astraw Date: 2009-09-07 20:03:12 +0000 (Mon, 07 Sep 2009) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/fill_units.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestFill.py trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/fill_units.png (from rev 7686, trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-09-07 20:02:56 UTC (rev 7686) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-09-07 20:03:12 UTC (rev 7687) @@ -128,3 +128,45 @@ ax.set_ylim( -20, 20 ) fig.savefig( 'polar_coords' ) +@image_comparison(baseline_images=['fill_units']) +def test_fill_units(): + """Test the fill method with unitized-data.""" + from datetime import datetime + import matplotlib.testing.jpl_units as units + units.register() + + # generate some data + t = units.Epoch( "ET", dt=datetime(2009, 4, 27) ) + value = 10.0 * units.deg + day = units.Duration( "ET", 24.0 * 60.0 * 60.0 ) + + fig = pylab.figure() + + # Top-Left + ax1 = fig.add_subplot( 221 ) + ax1.plot( [t], [value], yunits='deg', color='red' ) + ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], + [0.0, 0.0, 90.0, 0.0], 'b' ) + + # Top-Right + ax2 = fig.add_subplot( 222 ) + ax2.plot( [t], [value], yunits='deg', color='red' ) + ax2.fill( [t, t, t+day, t+day], + [0.0, 0.0, 90.0, 0.0], 'b' ) + + # Bottom-Left + ax3 = fig.add_subplot( 223 ) + ax3.plot( [t], [value], yunits='deg', color='red' ) + ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], + [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], 'b' ) + + # Bottom-Right + ax4 = fig.add_subplot( 224 ) + ax4.plot( [t], [value], yunits='deg', color='red' ) + ax4.fill( [t, t, t+day, t+day], + [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], + facecolor="blue" ) + + fig.autofmt_xdate() + fig.savefig( 'fill_units' ) + Deleted: trunk/matplotlib/test/test_plots/TestFill.py =================================================================== --- trunk/matplotlib/test/test_plots/TestFill.py 2009-09-07 20:02:56 UTC (rev 7686) +++ trunk/matplotlib/test/test_plots/TestFill.py 2009-09-07 20:03:12 UTC (rev 7687) @@ -1,87 +0,0 @@ -#======================================================================= -"""The Fill unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -import pylab -import numpy as npy -from datetime import datetime -# -#======================================================================= - -#======================================================================= -class TestFill( MplTestCase ): - """Test the various axes fill methods.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - units.register() - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def test_fill_units( self ): - """Test the fill method with unitized-data.""" - - fname = self.outFile( "fill_units.png" ) - - # generate some data - t = units.Epoch( "ET", dt=datetime(2009, 4, 27) ) - value = 10.0 * units.deg - day = units.Duration( "ET", 24.0 * 60.0 * 60.0 ) - - fig = pylab.figure() - - # Top-Left - ax1 = fig.add_subplot( 221 ) - ax1.plot( [t], [value], yunits='deg', color='red' ) - ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], - [0.0, 0.0, 90.0, 0.0], 'b' ) - - # Top-Right - ax2 = fig.add_subplot( 222 ) - ax2.plot( [t], [value], yunits='deg', color='red' ) - ax2.fill( [t, t, t+day, t+day], - [0.0, 0.0, 90.0, 0.0], 'b' ) - - # Bottom-Left - ax3 = fig.add_subplot( 223 ) - ax3.plot( [t], [value], yunits='deg', color='red' ) - ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], - [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], 'b' ) - - # Bottom-Right - ax4 = fig.add_subplot( 224 ) - ax4.plot( [t], [value], yunits='deg', color='red' ) - ax4.fill( [t, t, t+day, t+day], - [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], - facecolor="blue" ) - - fig.autofmt_xdate() - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- - Deleted: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |