test_init.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # -*- coding: utf-8 -*-
  2. # Copyright (c) 2021, Brandon Nielsen
  3. # All rights reserved.
  4. #
  5. # This software may be modified and distributed under the terms
  6. # of the BSD license. See the LICENSE file for details.
  7. import unittest
  8. import aniso8601
  9. class TestInitFunctions(unittest.TestCase):
  10. def test_import(self):
  11. # Verify the function mappings
  12. self.assertEqual(aniso8601.parse_datetime, aniso8601.time.parse_datetime)
  13. self.assertEqual(aniso8601.parse_time, aniso8601.time.parse_time)
  14. self.assertEqual(
  15. aniso8601.get_time_resolution, aniso8601.time.get_time_resolution
  16. )
  17. self.assertEqual(
  18. aniso8601.get_datetime_resolution, aniso8601.time.get_datetime_resolution
  19. )
  20. self.assertEqual(aniso8601.parse_date, aniso8601.date.parse_date)
  21. self.assertEqual(
  22. aniso8601.get_date_resolution, aniso8601.date.get_date_resolution
  23. )
  24. self.assertEqual(aniso8601.parse_duration, aniso8601.duration.parse_duration)
  25. self.assertEqual(
  26. aniso8601.get_duration_resolution,
  27. aniso8601.duration.get_duration_resolution,
  28. )
  29. self.assertEqual(aniso8601.parse_interval, aniso8601.interval.parse_interval)
  30. self.assertEqual(
  31. aniso8601.parse_repeating_interval,
  32. aniso8601.interval.parse_repeating_interval,
  33. )
  34. self.assertEqual(
  35. aniso8601.get_interval_resolution,
  36. aniso8601.interval.get_interval_resolution,
  37. )
  38. self.assertEqual(
  39. aniso8601.get_repeating_interval_resolution,
  40. aniso8601.interval.get_repeating_interval_resolution,
  41. )