Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #597 Add unit testing for sort_dictionary function #673

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tests/core/utility.test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
This is the utility unit testing module
"""

import sys
import unittest
from core import utility

sys.path.insert(1, '../../')


class UtilityTesting(unittest.TestCase):
"""
This is the class that tests the utility module functions.
"""

def test_sort_dictonary(self):
"""Tests if the function sorts the input dictionary."""

input_dict = {
'a': 1,
'c': 3,
'd': 23,
'b': 2,
}
sorted_dict = {
'a': 1,
'b': 2,
'c': 3,
'd': 23,
}
self.assertDictEqual(utility.sort_dictonary(input_dict), sorted_dict)


if __name__ == '__main__':
unittest.main()