Design Architecture for Utility Functions (iss-1ac610bafd4c)
This commit is contained in:
parent
ec3ff85206
commit
bf82717aa9
1 changed files with 16 additions and 0 deletions
16
tests/test_date_utils.py
Normal file
16
tests/test_date_utils.py
Normal 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()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue