Update tests/test_utils_readable.py
Run CI Tests / test (push) Successful in 1m41s

This commit is contained in:
2025-08-04 14:51:11 +02:00
parent 4e955a3765
commit 5ed98a56ed
+17 -22
View File
@@ -9,37 +9,32 @@ from slic.utils.readable import readable_seconds
(120.1, "2 minutes"),
(3599.9, "60 minutes"),
(3600.1, "1 hour"),
(7199.9, "2 hours"),
(3600.1, "60 minutes"),
(7199.9, "120 minutes"),
(7200.1, "2 hours"),
(90.4, "90 seconds"),
(90.6, "91 seconds"),
(121.9, "2 minutes"),
(3660.1, "1 hour"),
(1296000.0, "15 days"), # 15 * 86400
(2332800.0, "27 days"), # 27 * 86400
(2592000.0, "1 month"), # 30 * 86400
(2678400.0, "1 month"), # 31 * 86400
(3888000.0, "2 months"), # 45 * 86400
(5097600.0, "2 months"), # 59 * 86400
(5184000.0, "2 months"), # 60 * 86400
(5270400.0, "2 months"), # 61 * 86400
(1296000.0, "15 days"),
(2332800.0, "27 days"),
(2592000.0, "4 weeks"),
(2800000.0, "5 weeks"),
(3888000.0, "6 weeks"),
(23328000.0, "9 months"), # 9 * 2592000
(31104000.0, "1 year"), # 12 * 2592000
(33696000.0, "1 year"), # 13 * 2592000
(59616000.0, "2 years"), # 23 * 2592000
(62208000.0, "2 years"), # 24 * 2592000
(5097600.0, "8 weeks"),
(5184000.0, "9 weeks"),
(5270400.0, "2 months"),
(5158080.0, "2 months"), # 1.99 * 2592000
(5209920.0, "2 months"), # 2.01 * 2592000
(30844800.0, "12 months"), # 11.9 * 2592000
(31363200.0, "1 year"), # 12.1 * 2592000
(23328000.0, "9 months"),
(31104000.0, "12 months"),
(33696000.0, "13 months"),
(59616000.0, "23 months"),
(62208000.0, "24 months"),
(3153600.0, "1 month"), # 0.1 * 31536000
(15452640.0, "5 months"), # 0.49 * 31536000
(64208000.0, "2 years"),
])
def test_readable_seconds(seconds, expected):
assert readable_seconds(seconds) == expected