Skip to content

Commit

Permalink
Config manager can now take input
Browse files Browse the repository at this point in the history
This is intended to fix test_config_files.py as used in content-resolver-input CI.
  • Loading branch information
Fan authored Nov 26, 2024
1 parent 8bd9ce0 commit e8189d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion content_resolver/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

class ConfigManager:
def __init__(self, config_file=None):
self.settings = self.load_settings()
if config_file is not None:
self.settings = config_file
else:
self.settings = self.load_settings()


def load_settings(self):
Expand Down
6 changes: 3 additions & 3 deletions test_config_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3

import content_resolver.config_manager
from content_resolver.config_manager import ConfigManager

def create_mock_settings():
settings = {}
Expand All @@ -11,8 +11,8 @@ def create_mock_settings():
return settings

def main():
config_manager = content_resolver.config_manager.ConfigManager()
config_manager.get_configs(create_mock_settings())
config_manager = ConfigManager(create_mock_settings())
config_manager.get_configs()

if __name__ == "__main__":
main()

0 comments on commit e8189d4

Please sign in to comment.