File size: 1,466 Bytes
82f9be0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
"""
ζΉιθΏθ‘ζζζ΅θ―
"""
import unittest
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
def run_unit_tests():
"""θΏθ‘εε
ζ΅θ―"""
print("=== θΏθ‘εε
ζ΅θ― ===")
loader = unittest.TestLoader()
suite = loader.discover('tests/unit', pattern='test_*.py')
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
return result.wasSuccessful()
def run_integration_tests():
"""θΏθ‘ιζζ΅θ―"""
print("\n=== θΏθ‘ιζζ΅θ― ===")
loader = unittest.TestLoader()
suite = loader.discover('tests/integration', pattern='test_*.py')
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
return result.wasSuccessful()
def run_all_tests():
"""θΏθ‘ζζζ΅θ―"""
print("Human-Clone η³»η»ζ΅θ―ε₯δ»Ά")
print("=" * 50)
unit_success = run_unit_tests()
integration_success = run_integration_tests()
print("\n=== ζ΅θ―η»ζζ±ζ» ===")
print(f"εε
ζ΅θ―: {'β ιθΏ' if unit_success else 'β ε€±θ΄₯'}")
print(f"ιζζ΅θ―: {'β ιθΏ' if integration_success else 'β ε€±θ΄₯'}")
if unit_success and integration_success:
print("π ζζζ΅θ―ιθΏ!")
return True
else:
print("β εε¨ζ΅θ―ε€±θ΄₯")
return False
if __name__ == "__main__":
success = run_all_tests()
sys.exit(0 if success else 1) |