Files
my-pal-mcp-server/tests
Sven Lito 84de9b026f Address PR review feedback: Implement proper importlib.resources approach
Improvements based on gemini-code-assist bot feedback:

1. **Proper importlib.resources implementation:**
   - Use files("providers") / "../conf/custom_models.json" for resource loading
   - Prioritize resource loading over file system paths for packaged environments
   - Maintain backward compatibility with explicit config paths and env variables

2. **Remove redundant path checks:**
   - Eliminated duplicate Path("conf/custom_models.json") and Path.cwd() / "conf/custom_models.json"
   - Streamlined fallback logic to development path + working directory only

3. **Enhanced test coverage:**
   - Mock-based testing of actual fallback scenarios with Path.exists
   - Proper resource loading simulation and failure testing
   - Comprehensive coverage of both resource and file system modes

4. **Robust error handling:**
   - Graceful fallback from resources to file system when resource loading fails
   - Clear logging of which loading method is being used
   - Better error messages indicating resource vs file system loading

The implementation now follows Python packaging best practices using importlib.resources
while maintaining full backward compatibility and robust fallback behavior.

Tested: All 8 test cases pass, resource loading works in development,
file system fallback works when resources fail.
2025-08-10 21:36:40 +07:00
..
2025-08-08 09:39:07 +05:00
2025-08-08 05:26:45 +05:00
2025-06-27 14:29:10 +04:00
2025-08-08 12:59:41 +05:00
2025-06-27 14:29:10 +04:00
2025-06-21 08:21:34 +04:00
2025-08-08 11:11:22 +05:00