New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for the Config class #248
base: main
Are you sure you want to change the base?
Conversation
Following #24 major changes, there is some conflict on this branch. |
fix: eliminate the reloading of the config file at each call to Config. fix and refactor: create the setup fixture and add it to each tests fix: delete the instance before loading in test_save_then_load_keep_config_unchanged
This allows the tests not to depend on the implementation
is it working? |
so can you add one functionality? when the config.sample.toml file changes like added the new variables it automatically update the config.toml without touching the API keys values. just adding the new variables. also why do we need a dedicated file for testing config? |
I'm not sure what you mean. So, please tell me if I understand it correctly. I have some questions about this. About the dedicated file for testing config, are you speaking of having a file that contains all the tests for the class Config? If so, this is the usual way to go about testing classes. Or, about the temporary file that those tests use? In this case, this is the easiest way to check if saving and loading config data works while keeping those tests implementation-agnostic. If we wanted to remove it, we could maybe simulate the temporary file or we can tie the tests to calls to toml functions. |
tests/test_config.py
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT:
Delete extra lines
The main goal of this pull request is to add tests to the Config class.
Additional changes:
This is necessary for testing purposes and good practice in general.
This is necessary for testing purposes and good practice in general.
To have the same function names as toml
This is useful not to commit VS Code project settings
This pull request includes the commit from #221, so I will close it.