Skip to content

Commit 267c153

Browse files
committed
python-stdlib/datetime: add more tests.
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
1 parent 3a90853 commit 267c153

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

python-stdlib/datetime/test_datetime.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# See https://github.com/python/cpython/blob/3.9/Lib/test/datetimetester.py
12
import unittest
23
from datetime import\
34
timedelta as td,\
@@ -685,6 +686,21 @@ def test_compare17(self):
685686
def test_compare18(self):
686687
self.assertFalse(d5 <= d2)
687688

689+
def test_resolution01(self):
690+
self.assertIsInstance(td.min, td)
691+
692+
def test_resolution02(self):
693+
self.assertIsInstance(td.max, td)
694+
695+
def test_resolution03(self):
696+
self.assertIsInstance(td.resolution, td)
697+
698+
def test_resolution04(self):
699+
self.assertTrue(td.max > td.min)
700+
701+
def test_resolution04(self):
702+
self.assertEqual(td.resolution, td(nanoseconds=1))
703+
688704
def test_astimezone01(self):
689705
self.assertEqual(d3.astimezone(tz.utc), dt(2002, 3, 1, 11, 59, 59, 0, tz.utc))
690706

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy