Skip to content

Conversation

@javidahmed64592
Copy link
Owner

This pull request refactors the configuration loading mechanism in TemplateServer to improve flexibility and clarity. The main change is that the server now accepts a full configuration file path, rather than just a filename, which enhances configurability and testability. Related tests have been updated to reflect this new behavior.

Configuration loading improvements:

  • The TemplateServer constructor now takes a config_filepath parameter (defaulting to CONFIG_DIR / CONFIG_FILE_NAME) instead of just a filename, allowing users to specify the full path to the configuration file. (python_template_server/template_server.py)
  • The load_config method now requires a Path object for the configuration file path, and all references within the method have been updated to use this parameter, improving clarity and error messaging. (python_template_server/template_server.py)
  • The initialization logic in TemplateServer.__init__ now calls load_config(config_filepath) instead of load_config(), ensuring the correct path is used. (python_template_server/template_server.py)

Testing updates:

  • Added and updated tests to verify that load_config is called with the specified file path and that the configuration is loaded as expected. (tests/test_template_server.py)
  • Imports in the test file were updated to include Path for consistency with the new parameter type. (tests/test_template_server.py)

@javidahmed64592 javidahmed64592 merged commit 9a32ce6 into main Nov 30, 2025
7 checks passed
@javidahmed64592 javidahmed64592 deleted the add-custom-config-path branch November 30, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants