Skip to content

Commit

Permalink
TST: add test for fix of pandas-dev#12405
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdlovell committed Oct 31, 2016
1 parent 5a3ec26 commit f7823df
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pandas.compat import lrange, zip

import numpy as np
from pandas import Index, Series, DataFrame
from pandas import Index, Series, DataFrame, NaT

from pandas.tseries.index import date_range, bdate_range
from pandas.tseries.offsets import DateOffset
Expand Down Expand Up @@ -778,6 +778,23 @@ def test_mixed_freq_irreg_period(self):
irreg.plot()
ps.plot()

def test_nat_handling(self):

import matplotlib.pyplot as plt

fig = plt.gcf()
plt.clf()
ax = plt.gca()

dti = DatetimeIndex(['2015-01-01', NaT, '2015-01-03'])
s = Series(range(len(dti)), dti)
s.plot(ax=ax)
xdata = ax.get_lines()[0].get_xdata()
# plot x data is bounded by index values
self.assertLessEqual(s.index.min(), Series(xdata).min())
self.assertLessEqual(Series(xdata).max(), s.index.max())
_check_plot_works(s.plot)

@slow
def test_to_weekly_resampling(self):
idxh = date_range('1/1/1999', periods=52, freq='W')
Expand Down

0 comments on commit f7823df

Please sign in to comment.