Design Architecture for Utility Functions #2

Open
forge-bot wants to merge 9 commits from forge/iss-1ac610bafd4c into main
Showing only changes of commit bf82717aa9 - Show all commits

16
tests/test_date_utils.py Normal file
View file

@ -0,0 +1,16 @@
import unittest
from utils.date_utils import get_current_date, format_date
from datetime import datetime
class TestDateUtils(unittest.TestCase):
def test_get_current_date(self):
self.assertEqual(get_current_date(), datetime.now().strftime('%Y-%m-%d'))
def test_format_date(self):
date = datetime(2023, 1, 1)
self.assertEqual(format_date(date, '%d-%m-%Y'), '01-01-2023')
if __name__ == '__main__':
unittest.main()