Spaces:
Sleeping
Sleeping
Download src/gaia/agent/tests/run_tests.py from jm-vis/Final_Assignment_GAIAAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/jm-vis/Final_Assignment_GAIAAgent/resolve/main/src/gaia/agent/tests/run_tests.py
- Command line
-
hf download hf://spaces/jm-vis/Final_Assignment_GAIAAgent/src/gaia/agent/tests/run_tests.py
-
curl -L -o run_tests.py https://huggingface.co/spaces/jm-vis/Final_Assignment_GAIAAgent/resolve/main/src/gaia/agent/tests/run_tests.py
1.54 kB
| """ | |
| Test runner for GAIA agent components. | |
| This script runs tests for all GAIA agent components including: | |
| - Answer formatter | |
| - Integrated agent | |
| - Multimodal processing | |
| """ | |
| import unittest | |
| import os | |
| import sys | |
| # Ensure we can import from the parent directory | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| # Import test modules | |
| from test_answer_formatter import TestAnswerFormatter | |
| from test_integrated_agent import TestIntegratedAgent | |
| if __name__ == "__main__": | |
| print("Running GAIA agent tests...") | |
| # Create the test loader | |
| loader = unittest.TestLoader() | |
| # Create a test suite including all tests | |
| suite = unittest.TestSuite() | |
| # Add the TestAnswerFormatter tests | |
| print("Adding answer formatter tests...") | |
| formatter_suite = loader.loadTestsFromTestCase(TestAnswerFormatter) | |
| suite.addTest(formatter_suite) | |
| # Add the TestIntegratedAgent tests | |
| print("Adding integrated agent tests...") | |
| integrated_suite = loader.loadTestsFromTestCase(TestIntegratedAgent) | |
| suite.addTest(integrated_suite) | |
| # Run the tests with verbosity | |
| print("\nRunning all tests...\n") | |
| runner = unittest.TextTestRunner(verbosity=2) | |
| result = runner.run(suite) | |
| # Report results | |
| if result.wasSuccessful(): | |
| print("\nAll tests passed successfully!") | |
| sys.exit(0) | |
| else: | |
| print("\nSome tests failed!") | |
| print(f"Failures: {len(result.failures)}") | |
| print(f"Errors: {len(result.errors)}") | |
| sys.exit(1) |