From: <as...@us...> - 2009-09-07 20:05:40
|
Revision: 7695 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7695&view=rev Author: astraw Date: 2009-09-07 20:05:29 +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/axhspan_epoch.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestSpan.py trunk/matplotlib/test/test_plots/baseline/TestSpan/axhspan_epoch.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png (from rev 7694, trunk/matplotlib/test/test_plots/baseline/TestSpan/axhspan_epoch.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:05:12 UTC (rev 7694) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-09-07 20:05:29 UTC (rev 7695) @@ -334,3 +334,25 @@ ax.set_xlim( t0 - 5.0*dt, tf + 5.0*dt ) fig.savefig( 'axvspan_epoch' ) + +@image_comparison(baseline_images=['axhspan_epoch']) +def test_axhspan_epoch(): + """Test the axhspan method with Epochs.""" + from datetime import datetime + import matplotlib.testing.jpl_units as units + units.register() + + # generate some data + t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) ) + tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) ) + + dt = units.Duration( "ET", units.day.convert( "sec" ) ) + + fig = pylab.figure() + + pylab.axhspan( t0, tf, facecolor="blue", alpha=0.25 ) + + ax = pylab.gca() + ax.set_ylim( t0 - 5.0*dt, tf + 5.0*dt ) + + fig.savefig( 'axhspan_epoch' ) Deleted: trunk/matplotlib/test/test_plots/TestSpan.py =================================================================== --- trunk/matplotlib/test/test_plots/TestSpan.py 2009-09-07 20:05:12 UTC (rev 7694) +++ trunk/matplotlib/test/test_plots/TestSpan.py 2009-09-07 20:05:29 UTC (rev 7695) @@ -1,64 +0,0 @@ -#======================================================================= -"""The Span 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 TestSpan( MplTestCase ): - """Test the various axes spanning 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_axhspan_epoch( self ): - """Test the axhspan method with Epochs.""" - - fname = self.outFile( "axhspan_epoch.png" ) - - # generate some data - t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) ) - tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) ) - - dt = units.Duration( "ET", units.day.convert( "sec" ) ) - - fig = pylab.figure() - - pylab.axhspan( t0, tf, facecolor="blue", alpha=0.25 ) - - ax = pylab.gca() - ax.set_ylim( t0 - 5.0*dt, tf + 5.0*dt ) - - fig.savefig( fname ) - self.checkImage( fname ) Deleted: trunk/matplotlib/test/test_plots/baseline/TestSpan/axhspan_epoch.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |