示例#1
0
    def test_dt_str_none(self):

        dt = datetime(2013, 1, 1)

        result = api.arrow(dt)

        assertDtEqual(result._datetime, dt.replace(tzinfo=tz.tzutc()))
示例#2
0
    def test_int(self):

        timestamp = int(time.time())

        result = api.arrow(time.time())

        assertDtEqual(result, api.utcnow())
示例#3
0
    def test_int(self):

        timestamp = int(time.time())

        result = api.arrow(time.time())

        assertDtEqual(result, api.utcnow())
示例#4
0
    def test_dt_str_none(self):

        dt = datetime(2013, 1, 1)

        result = api.arrow(dt)

        assertDtEqual(result._datetime, dt.replace(tzinfo=tz.tzutc()))
示例#5
0
    def test_datetime_tzinfo(self):

        result = api.arrow(datetime(2013, 1, 1), "local")

        assertEqual(result._datetime, datetime(2013, 1, 1, tzinfo=tz.tzlocal()))
示例#6
0
    def test_none_tz(self):

        result = api.arrow("local")

        assertDtEqual(result._datetime, datetime.now(tz.tzlocal()))
示例#7
0
    def test_none_none(self):

        result = api.arrow()

        assertDtEqual(result._datetime, datetime.utcnow().replace(tzinfo=tz.tzutc()))
示例#8
0
    def test_arrow(self):

        expect(api._factory.arrow).args(date='date', tz='tz').returns('arrow')

        assertEqual(api.arrow('date', 'tz'), 'arrow')
示例#9
0
    def test_datetime_tzinfo(self):

        result = api.arrow(datetime(2013, 1, 1), 'local')

        assertEqual(result._datetime, datetime(2013, 1, 1,
                                               tzinfo=tz.tzlocal()))
示例#10
0
    def test_none_tz(self):

        result = api.arrow('local')

        assertDtEqual(result._datetime, datetime.now(tz.tzlocal()))
示例#11
0
    def test_none_none(self):

        result = api.arrow()

        assertDtEqual(result._datetime,
                      datetime.utcnow().replace(tzinfo=tz.tzutc()))