-
Notifications
You must be signed in to change notification settings - Fork 176
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
Config tests #678
Open
brothercorvo
wants to merge
23
commits into
master
Choose a base branch
from
config-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Config tests #678
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a6676e9
Rewrite of MainConfig.py to use singleton
hickey 71e7420
Added PyTest modules to requirements.txt
hickey 7caeaa7
Initial set of tests for MainConfig
hickey 43d0dbe
Handle readonly values better in MainConfig
hickey c27bb73
Removed FTS_FED_PASSWORD as not documented
hickey ffef445
Added processing of YAML config
hickey d71dbdb
Added testing of YAML config
hickey cb5d54b
Fixed MainConfig to handle bool env vars
hickey 2c31620
Fixed default paths based on common variable
hickey 11f30e4
Added test of YAML config with env var overrides
hickey 1c8cc11
Added tests to validate config as attributes
hickey 95cc19b
Mass update of code accessing MainConfig
hickey da375f9
Added AllowCLIIPs to new config architecture
hickey f1a9565
Added tests for dealing with list vars (i.e. AllowCLIIPs)
hickey 15ed052
Moved constants to top of MainConfig.py for readability
hickey 3d1aeaa
Moved nodeID into new config structure
hickey 7d74c67
Added reset() to reinit config for testing
hickey f71429e
Added version and CLIIP to config structure
hickey f94a5d2
Refactored ip var to private
hickey 01b5104
Fixed calls for config information
hickey f28c6e2
Added tests for config vars with dict access
hickey 1f885e7
Updated comments to assist other devs
hickey 34518fc
Clean up from a bad merge
hickey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
FreeTAKServer/controllers/configuration/DatabaseConfiguration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
from FreeTAKServer.controllers.configuration.MainConfig import MainConfig | ||
|
||
# Make a connection to the MainConfig object for all routines below | ||
config = MainConfig.instance() | ||
|
||
class DatabaseConfiguration: | ||
DataBasePath = MainConfig.DBFilePath | ||
if MainConfig.DataBaseType == "SQLite": | ||
DataBasePath = config.DBFilePath | ||
if config.DataBaseType == "SQLite": | ||
DataBaseType = str('sqlite:///') | ||
elif MainConfig.DataBaseType == "MySQL": | ||
elif config.DataBaseType == "MySQL": | ||
DataBaseType = str('mysql://') | ||
DataBaseConnectionString = str(DataBaseType+DataBasePath) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / SonarCloud
Server certificates should be verified during SSL/TLS connections High