string representation tests
This commit is contained in:
parent
1c480fd366
commit
b82715aeb7
16
tests/string_repr_test.py
Normal file
16
tests/string_repr_test.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import unittest
|
||||||
|
from datetime import datetime
|
||||||
|
from fixedcal import FixedDate
|
||||||
|
|
||||||
|
class TestStringRepresentation(unittest.TestCase):
|
||||||
|
def test_string_of_ordinary_date(self):
|
||||||
|
fixed_date = FixedDate(date=datetime(2022, 4, 15))
|
||||||
|
self.assertEqual(str(fixed_date), "2022-04-21")
|
||||||
|
|
||||||
|
def test_string_of_date_in_november(self):
|
||||||
|
fixed_date = FixedDate(date=datetime(2022, 11, 11))
|
||||||
|
self.assertEqual(str(fixed_date), "2022-12-07")
|
||||||
|
|
||||||
|
def test_string_of_year_day(self):
|
||||||
|
fixed_date = FixedDate(day_of_year=365, year=2022)
|
||||||
|
self.assertEqual(str(fixed_date), "2022-14-01")
|
Loading…
x
Reference in New Issue
Block a user