Skip to content

Commit

Permalink
defines bergamo settings from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
mekhlakapoor committed Oct 22, 2024
1 parent bcf72c1 commit a52cf67
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_gather_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,25 @@ def test_run_job_main_metadata(
self.assertIsNotNone(json_contents.get("_id"))
self.assertIsNone(json_contents.get("id"))

def test_from_job_settings_file(self):
"""Tests that users can set a session config file when requesting
GatherMetadataJob"""

bergamo_settings = BergamoSessionJobSettings(user_settings_config_file=EXAMPLE_BERGAMO_CONFIGS)
test_configs = {
"directory_to_write_to": RESOURCES_DIR,
"session_settings": {
"job_settings": bergamo_settings.model_dump()
},
}
job_settings = JobSettings.model_validate_json(
json.dumps(test_configs, default=str)
)
self.assertEqual(
["John Apple"],
job_settings.session_settings.job_settings.experimenter_full_name,
)


if __name__ == "__main__":
unittest.main()

0 comments on commit a52cf67

Please sign in to comment.