diff options
author | Christian Struck <christian@struck.se> | 2013-01-31 15:50:09 +0100 |
---|---|---|
committer | Christian Struck <christian@struck.se> | 2013-01-31 15:50:09 +0100 |
commit | 59929df267e4480a9f7c123c4e22c28b49e78758 (patch) | |
tree | cbdd5555b61a0e3e3edc6dfc31d0db9828a22ddc /tests | |
parent | 6a71307e5affd7653db04d9943c77cccf30c3886 (diff) | |
download | bvg-grabber-59929df267e4480a9f7c123c4e22c28b49e78758.tar.gz bvg-grabber-59929df267e4480a9f7c123c4e22c28b49e78758.tar.bz2 bvg-grabber-59929df267e4480a9f7c123c4e22c28b49e78758.zip |
Added test for the new dateformat
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_format.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_format.py b/tests/test_format.py index 9c3e35e..8e7827e 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -2,8 +2,7 @@ import datetime import unittest -from bvggrabber.api import fullformat, hourformat -from bvggrabber.utils.format import int2bin +from bvggrabber.utils.format import int2bin, fullformat, dateformat, timeformat class TestFormats(unittest.TestCase): @@ -21,11 +20,12 @@ class TestFormats(unittest.TestCase): def test_datetime_formats(self): f = [(datetime.datetime(2013, 1, 2, 3, 4, 0), - "2013-01-02 03:04:00", "03:04"), - (datetime.datetime(2013, 1, 2), - "2013-01-02 00:00:00", "00:00"), - (datetime.datetime(2013, 1, 2, 3, 4, 30), - "2013-01-02 03:04:30", "03:04")] - for dt, sf, sh in f: + "2013-01-02 03:04:00", "03:04", "02.01.2013"), + (datetime.datetime(2013, 5, 2), + "2013-05-02 00:00:00", "00:00", "02.05.2013"), + (datetime.datetime(2013, 2, 2, 3, 4, 30), + "2013-02-02 03:04:30", "03:04", "02.02.2013")] + for dt, sf, st, sd in f: self.assertEqual(fullformat(dt), sf) - self.assertEqual(hourformat(dt), sh) + self.assertEqual(dateformat(dt), sd) + self.assertEqual(timeformat(dt), st) |