Example #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()))
Example #2
0
    def test_int(self):

        timestamp = int(time.time())

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

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

        timestamp = int(time.time())

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

        assertDtEqual(result, api.utcnow())
Example #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()))
Example #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()))
Example #6
0
    def test_none_tz(self):

        result = api.arrow("local")

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

        result = api.arrow()

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

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

        assertEqual(api.arrow('date', 'tz'), 'arrow')
Example #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()))
Example #10
0
    def test_none_tz(self):

        result = api.arrow('local')

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

        result = api.arrow()

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