__init__.py 655 B

12345678910111213141516171819202122232425
  1. # coding=utf-8
  2. """
  3. DDNS Tests Package
  4. """
  5. import sys
  6. import os
  7. import unittest
  8. try:
  9. from unittest.mock import patch, MagicMock, call
  10. except ImportError: # Python 2
  11. from mock import patch, MagicMock, call # type: ignore
  12. __all__ = ["patch", "MagicMock", "unittest", "call"]
  13. # 添加当前目录到 Python 路径,这样就可以直接导入 test_base
  14. current_dir = os.path.dirname(__file__)
  15. if current_dir not in sys.path:
  16. sys.path.insert(0, current_dir)
  17. # 添加上级目录到 Python 路径,这样就可以导入 ddns 模块
  18. parent_dir = os.path.dirname(current_dir)
  19. if parent_dir not in sys.path:
  20. sys.path.insert(0, parent_dir)