-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_dateutils.py
More file actions
21 lines (17 loc) · 783 Bytes
/
test_dateutils.py
File metadata and controls
21 lines (17 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import unittest
from dateutils import get_latest_date_strings_list
from dateutils import get_custom_date_string
class TestDateUtils(unittest.TestCase):
def test_get_latest_date_strings_list_should_return_non_empty_list(self):
result = get_latest_date_strings_list()
self.assertTrue(len(result) > 0)
def test_get_custom_date_string_should_return_non_empty_string(self):
datestringinput = "2022-07-23"
result = get_custom_date_string(datestringinput)
expected = "220723"
self.assertEqual(result, expected)
def test_get_latest_date_strings_list_should_return_10_members(self):
result = get_latest_date_strings_list()
self.assertTrue(len(result) == 10)
if __name__ == '__main__':
unittest.main()