Skip to content

Commit

Permalink
Fix test for from_config
Browse files Browse the repository at this point in the history
  • Loading branch information
TorecLuik committed Dec 18, 2024
1 parent d2704ee commit d8fb49f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit/test_slurm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ def test_from_config(mock_ConfigParser,
configfile = 'test_config.ini'
init_slurm = True
mock_SlurmClient.return_value = None
config_only = False

# Create a MagicMock instance to represent the ConfigParser object
mock_configparser_instance = MagicMock()
Expand Down Expand Up @@ -1242,7 +1243,7 @@ def items_side_effect(section):
# WHEN
# Call the class method that uses configparser
SlurmClient.from_config(
configfile=configfile, init_slurm=init_slurm)
configfile=configfile, init_slurm=init_slurm, config_only=config_only)

# THEN
mock_configparser_instance.read.assert_called_once_with([
Expand All @@ -1269,7 +1270,8 @@ def items_side_effect(section):
enable_job_accounting=True, # expected enable_job_accounting value
enable_job_progress=True, # expected enable_job_progress value
enable_workflow_analytics=True, # expected enable_workflow_analytics value
sqlalchemy_url='sqlite:///test.db' # expected sqlalchemy_url value
sqlalchemy_url='sqlite:///test.db', # expected sqlalchemy_url value
config_only=config_only
)


Expand Down

0 comments on commit d8fb49f

Please sign in to comment.