MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / run_tests

Function run_tests

tests/test_reasoning_consolidation.py:324–373  ·  view source on GitHub ↗

Run all reasoning consolidation tests and provide summary

()

Source from the content-addressed store, hash-verified

322
323
324def run_tests():
325 """Run all reasoning consolidation tests and provide summary"""
326 print("Reasoning Consolidation - Test Suite")
327 print("=" * 60)
328 print("Testing reasoning content consolidation for non-streaming responses...")
329 print("=" * 60)
330
331 # Create test suite
332 test_classes = [
333 TestReasoningConsolidation,
334 TestReasoningConsolidationAsync
335 ]
336
337 total_tests = 0
338 passed_tests = 0
339
340 for test_class in test_classes:
341 print(f"\nRunning {test_class.__name__}...")
342 suite = unittest.TestLoader().loadTestsFromTestCase(test_class)
343 result = unittest.TextTestRunner(verbosity=2).run(suite)
344
345 total_tests += result.testsRun
346 passed_tests += result.testsRun - len(result.failures) - len(result.errors)
347
348 if result.failures:
349 print(f" X Failures: {len(result.failures)}")
350 for failure in result.failures:
351 print(f" - {failure[0]}")
352 if result.errors:
353 print(f" X Errors: {len(result.errors)}")
354 for error in result.errors:
355 print(f" - {error[0]}")
356
357 print("\n" + "=" * 60)
358 print("Test Summary:")
359 print(f" Total Tests: {total_tests}")
360 print(f" Passed: {passed_tests}")
361 print(f" Success Rate: {(passed_tests/total_tests)*100:.1f}%" if total_tests > 0 else " Success Rate: 0%")
362
363 if passed_tests == total_tests:
364 print("\nSUCCESS: All tests passed! Reasoning Consolidation feature is working correctly.")
365 print("PASS: Content consolidation with reasoning and body verified")
366 print("PASS: Edge cases (empty/whitespace content) handled correctly")
367 print("PASS: Large response chunking mechanism validated")
368 print("PASS: Tool calls integration confirmed")
369 print("PASS: Message payload structure validated")
370 else:
371 print(f"\nFAILURE: {total_tests - passed_tests} test(s) failed. Review the implementation.")
372
373 return passed_tests == total_tests
374
375
376if __name__ == "__main__":

Callers 1

Calls 1

runMethod · 0.45

Tested by

no test coverage detected