Mercurial > hg > hg-fastimport
comparison hgext3rd/fastimport/vendor/python_fastimport/tests/test_dates.py @ 86:28704a2a7461 vendor/python-fastimport
Import python-fastimport-0.9.8
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Tue, 19 Jan 2021 22:56:34 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 85:1f5544a8870b | 86:28704a2a7461 |
|---|---|
| 1 # Copyright (C) 2012 Canonical Ltd | |
| 2 # | |
| 3 # This program is free software; you can redistribute it and/or modify | |
| 4 # it under the terms of the GNU General Public License as published by | |
| 5 # the Free Software Foundation; either version 2 of the License, or | |
| 6 # (at your option) any later version. | |
| 7 # | |
| 8 # This program is distributed in the hope that it will be useful, | |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 11 # GNU General Public License for more details. | |
| 12 # | |
| 13 # You should have received a copy of the GNU General Public License | |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 15 | |
| 16 """Test parsing of dates.""" | |
| 17 | |
| 18 from unittest import TestCase | |
| 19 | |
| 20 from fastimport import ( | |
| 21 dates, | |
| 22 ) | |
| 23 | |
| 24 class ParseTzTests(TestCase): | |
| 25 | |
| 26 def test_parse_tz_utc(self): | |
| 27 self.assertEqual(0, dates.parse_tz(b'+0000')) | |
| 28 self.assertEqual(0, dates.parse_tz(b'-0000')) | |
| 29 | |
| 30 def test_parse_tz_cet(self): | |
| 31 self.assertEqual(3600, dates.parse_tz(b'+0100')) | |
| 32 | |
| 33 def test_parse_tz_odd(self): | |
| 34 self.assertEqual(1864800, dates.parse_tz(b'+51800')) |
