Skip to content

Commit f52189a

Browse files
committed
Fix test
1 parent 78e5a17 commit f52189a

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

tests/unit/test_slurm_client.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -477,23 +477,21 @@ def test_descriptor_from_github(slurm_client):
477477
mock_parse.return_value = mock_schema
478478

479479
slurm_client.slurm_model_repos = repos
480-
with patch.object(slurm_client, 'convert_url', return_value=expected_raw_url):
481-
mock_get.return_value.ok = True
482-
mock_get.return_value.json.return_value = raw_descriptor
480+
mock_get.return_value.ok = True
481+
mock_get.return_value.json.return_value = raw_descriptor
483482

484483
# WHEN
485-
descriptor = slurm_client.generic_descriptor_from_github(workflow)
484+
descriptor = slurm_client.generic_descriptor_from_github(workflow)
486485

487486
# THEN
488-
slurm_client.convert_url.assert_called_once_with(git_repo)
489-
mock_get.assert_called_with(expected_raw_url)
490-
mock_parse.assert_called_once_with(raw_descriptor, name=workflow)
491-
assert descriptor == expected_descriptor
487+
mock_get.assert_called_with(expected_raw_url)
488+
mock_parse.assert_called_once_with(raw_descriptor, name=workflow)
489+
assert descriptor == expected_descriptor
492490

493491
# WHEN & THEN
494-
mock_get.return_value.ok = False
495-
with pytest.raises(ValueError, match="Error while pulling descriptor file"):
496-
slurm_client.generic_descriptor_from_github(workflow)
492+
mock_get.return_value.ok = False
493+
with pytest.raises(ValueError, match="No descriptor file found for repository"):
494+
slurm_client.generic_descriptor_from_github(workflow)
497495

498496

499497
def test_convert_url(slurm_client):
@@ -2022,7 +2020,7 @@ def test_init_invalid_workflow_repo():
20222020
# GIVEN
20232021
# THEN
20242022
with pytest.raises(ValueError,
2025-
match="Error while pulling descriptor file"):
2023+
match="No descriptor file found for repository"):
20262024
# WHEN
20272025
invalid_url = "https://github.com/this-is-an-invalid-url/wf"
20282026
SlurmClient(

0 commit comments

Comments
 (0)