def test_dt_str_none(self): dt = datetime(2013, 1, 1) result = api.arrow(dt) assertDtEqual(result._datetime, dt.replace(tzinfo=tz.tzutc()))
def test_int(self): timestamp = int(time.time()) result = api.arrow(time.time()) assertDtEqual(result, api.utcnow())
def test_datetime_tzinfo(self): result = api.arrow(datetime(2013, 1, 1), "local") assertEqual(result._datetime, datetime(2013, 1, 1, tzinfo=tz.tzlocal()))
def test_none_tz(self): result = api.arrow("local") assertDtEqual(result._datetime, datetime.now(tz.tzlocal()))
def test_none_none(self): result = api.arrow() assertDtEqual(result._datetime, datetime.utcnow().replace(tzinfo=tz.tzutc()))
def test_arrow(self): expect(api._factory.arrow).args(date='date', tz='tz').returns('arrow') assertEqual(api.arrow('date', 'tz'), 'arrow')
def test_datetime_tzinfo(self): result = api.arrow(datetime(2013, 1, 1), 'local') assertEqual(result._datetime, datetime(2013, 1, 1, tzinfo=tz.tzlocal()))
def test_none_tz(self): result = api.arrow('local') assertDtEqual(result._datetime, datetime.now(tz.tzlocal()))