def test_drange():
 start = datetime.datetime(2011, 1, 1, tzinfo=mdates.UTC)
 end = datetime.datetime(2011, 1, 2, tzinfo=mdates.UTC)
 delta = datetime.timedelta(hours=1)
 assert_equal(24, len(mdates.drange(start, end, delta)))
 end = (end + datetime.timedelta(microseconds=1))
 assert_equal(25, len(mdates.drange(start, end, delta)))
 end = datetime.datetime(2011, 1, 2, tzinfo=mdates.UTC)
 delta = datetime.timedelta(hours=4)
 daterange = mdates.drange(start, end, delta)
 assert_equal(6, len(daterange))
 assert_equal(mdates.num2date(daterange[(-1)]), (end - delta))

def test_drange ( ) : start = datetime . datetime ( 2011 , 1 , 1 , tzinfo = mdates . UTC ) end = datetime . datetime ( 2011 , 1 , 2 , tzinfo = mdates . UTC ) delta = datetime . timedelta ( hours = 1 ) assert_equal ( 24 , len ( mdates . drange ( start , end , delta ) ) ) end = ( end + datetime . timedelta ( microseconds = 1 ) ) assert_equal ( 25 , len ( mdates . drange ( start , end , delta ) ) ) end = datetime . datetime ( 2011 , 1 , 2 , tzinfo = mdates . UTC ) delta = datetime . timedelta ( hours = 4 ) daterange = mdates . drange ( start , end , delta ) assert_equal ( 6 , len ( daterange ) ) assert_equal ( mdates . num2date ( daterange [ ( - 1 ) ] ) , ( end - delta ) )
this test should check if drange works as expected .