Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /pfun-health_pfun-cma-model /tests /test_base.py
| # tests/test_base.py | |
| # This file sets up the test environment for the pfun-cma-model package. | |
| import os | |
| import sys | |
| from pathlib import Path | |
| def setup_test_environment(): | |
| """Sets up the test environment by adding the root and module paths to sys.path. | |
| This allows the tests to import modules from the pfun-cma-model package. | |
| """ | |
| # Set environment variables for testing | |
| os.environ["DEBUG"] = "True" | |
| os.environ["Testing"] = "True" | |
| os.environ["SECRET_KEY"] = "test-secret-key-for-predictable-signatures" | |
| # Get the root path of the project (two levels up from this file) | |
| # and the module path (one level up from this file). | |
| root_path = str(Path(__file__).parents[2]) | |
| mod_path = str(Path(__file__).parents[1]) | |
| if root_path not in sys.path: | |
| sys.path.insert(0, root_path) | |
| if mod_path not in sys.path: | |
| sys.path.insert(0, mod_path) | |
| # Import the pfun_path_helper module to ensure it is available for use. | |
| import pfun_path_helper as pph # type: ignore | |
| return root_path, mod_path, pph | |
| root_path, mod_path, pph = setup_test_environment() | |
Xet Storage Details
- Size:
- 1.11 kB
- Xet hash:
- c7c47b54510723b7e22b1f60ee75d56a7c0c584fdaa3928eaaddf1bffa4da390
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.