test_configmanager_utils.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import unittest
  2. import os
  3. from kalliope.core.Utils.Utils import Utils
  4. class TestUtils(unittest.TestCase):
  5. """
  6. Class to test Utils methods
  7. """
  8. def setUp(self):
  9. pass
  10. def test_get_current_file_parent_parent_path(self):
  11. """
  12. Expect to get back the parent path file
  13. """
  14. path_to_test = "../kalliope/core/Utils"
  15. expected_result = os.path.normpath("../kalliope/core")
  16. self.assertEquals(Utils.get_current_file_parent_path(path_to_test),
  17. expected_result,
  18. "fail getting the parent parent path from the given path")
  19. def test_get_current_file_parent_parent_path(self):
  20. """
  21. Expect to get back the parent parent path file
  22. """
  23. path_to_test = "../kalliope/core/Utils"
  24. expected_result = os.path.normpath("../kalliope")
  25. self.assertEquals(Utils.get_current_file_parent_parent_path(path_to_test),
  26. expected_result,
  27. "fail getting the parent parent path from the given path")