Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f49dc9

Browse files
committed
test conversion: move old-style test to new-style test
svn path=/trunk/matplotlib/; revision=7683
1 parent 0efe877 commit 9f49dc9

3 files changed

Lines changed: 29 additions & 75 deletions

File tree

test/test_matplotlib/baseline/TestTickers/DateFormatter_fractionalSeconds.png renamed to lib/matplotlib/tests/baseline_images/test_dates/DateFormatter_fractionalSeconds.png

File renamed without changes.

lib/matplotlib/tests/test_dates.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,35 @@ def test_RRuleLocator():
113113

114114
fig.savefig( 'RRuleLocator_bounds' )
115115

116+
@image_comparison(baseline_images=['DateFormatter_fractionalSeconds'])
117+
def test_DateFormatter():
118+
"""Test DateFormatter"""
119+
import pylab
120+
from datetime import datetime
121+
import matplotlib.testing.jpl_units as units
122+
units.register()
123+
124+
# Lets make sure that DateFormatter will allow us to have tick marks
125+
# at intervals of fractional seconds.
126+
127+
t0 = datetime( 2001, 1, 1, 0, 0, 0 )
128+
tf = datetime( 2001, 1, 1, 0, 0, 1 )
129+
130+
fig = pylab.figure()
131+
ax = pylab.subplot( 111 )
132+
ax.set_autoscale_on( True )
133+
ax.plot( [t0, tf], [0.0, 1.0], marker='o' )
134+
135+
# rrule = mpldates.rrulewrapper( dateutil.rrule.YEARLY, interval=500 )
136+
# locator = mpldates.RRuleLocator( rrule )
137+
# ax.xaxis.set_major_locator( locator )
138+
# ax.xaxis.set_major_formatter( mpldates.AutoDateFormatter(locator) )
139+
140+
ax.autoscale_view()
141+
fig.autofmt_xdate()
142+
143+
fig.savefig( 'DateFormatter_fractionalSeconds' )
144+
116145
if __name__=='__main__':
117146
import nose
118147
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

test/test_matplotlib/TestTickers.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)