summaryrefslogtreecommitdiff
path: root/fastimport/tests/test_dates.py
blob: aae8b787cf3ac51cb8ca7aa023e7f1a3e151f9ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (C) 2012 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Test parsing of dates."""

from testtools import TestCase

from fastimport import (
    dates,
    )

class ParseTzTests(TestCase):

    def test_parse_tz_utc(self):
        self.assertEquals(0, dates.parse_tz("+0000"))
        self.assertEquals(0, dates.parse_tz("-0000"))

    def test_parse_tz_cet(self):
        self.assertEquals(3600, dates.parse_tz("+0100"))

    def test_parse_tz_odd(self):
        self.assertEquals(1864800, dates.parse_tz("+51800"))