This commit is contained in:
26
tests/test_anti_detect_import.py
Normal file
26
tests/test_anti_detect_import.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""anti_detect / rpa 子包导入冒烟。"""
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import unittest
|
||||
|
||||
|
||||
class TestAntiDetectImport(unittest.TestCase):
|
||||
def test_import_anti_detect(self) -> None:
|
||||
mod = importlib.import_module("jiangchang_skill_core.rpa.anti_detect")
|
||||
self.assertTrue(callable(mod.human_click))
|
||||
self.assertTrue(callable(mod.random_delay))
|
||||
|
||||
def test_import_rpa_package(self) -> None:
|
||||
mod = importlib.import_module("jiangchang_skill_core.rpa")
|
||||
self.assertTrue(callable(mod.wait_for_captcha_pass))
|
||||
self.assertIsNotNone(mod.stealth_enabled)
|
||||
|
||||
def test_top_level_import_with_rpa(self) -> None:
|
||||
pkg = importlib.import_module("jiangchang_skill_core")
|
||||
self.assertIsNotNone(getattr(pkg, "config", None))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user