From 7a1589bd78e6b8df4ebb45652379a6e8729b5cdb Mon Sep 17 00:00:00 2001 From: pbrassel <52356233+pbrassel@users.noreply.github.com> Date: Wed, 17 Dec 2025 14:27:11 +0100 Subject: [PATCH] fix: `create_analysis()` defaults Let `image_command_arguments` default to `None` since an empty tuple is not treated correctly by `ensure_position()`. --- flame_hub/_core_client.py | 2 +- tests/test_core.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/flame_hub/_core_client.py b/flame_hub/_core_client.py index cbd5447..0142ae9 100644 --- a/flame_hub/_core_client.py +++ b/flame_hub/_core_client.py @@ -546,7 +546,7 @@ def create_analysis( description: str = None, master_image_id: MasterImage | uuid.UUID | str = None, registry_id: Registry | uuid.UUID | str = None, - image_command_arguments: list[MasterImageCommandArgument] = (), + image_command_arguments: list[MasterImageCommandArgument] = None, ) -> Analysis: return self._create_resource( Analysis, diff --git a/tests/test_core.py b/tests/test_core.py index 975255d..2b689e0 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -423,6 +423,14 @@ def test_update_analysis(core_client, analysis): assert new_analysis.image_command_arguments == args # Note that args is modified during updating the analysis. +def test_create_analysis_without_arguments(core_client, project): + analysis = core_client.create_analysis(project_id=project.id, image_command_arguments=None) + + assert analysis.image_command_arguments == [] + + core_client.delete_analysis(analysis) + + def test_unlock_analysis(core_client, configured_analysis): assert ( core_client.send_analysis_command(configured_analysis.id, command="configurationUnlock").configuration_locked