diff --git a/executor/tests/test_credential.py b/executor/tests/test_credential.py index d030f842..5ce111b2 100644 --- a/executor/tests/test_credential.py +++ b/executor/tests/test_credential.py @@ -26,9 +26,7 @@ def test_replace_credential(self): v = replace_credential({ "c": f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}' }, { - "c": InputHandleDef(handle="c", json_schema={ - "contentMediaType": "oomol/credential" - }, value=None) + "c": InputHandleDef(**{"handle": "c", "json_schema": {"contentMediaType": "oomol/credential"}}) }) cred_input = v.get("c") self.assertIsInstance(cred_input, CredentialInput) @@ -54,6 +52,14 @@ def test_credential_without_content_media(self): # 'a' should remain unchanged since no input_def for it self.assertEqual(cred_input_a, f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}') + + def test_credential_no_handle_def(self): + """Test credential replacement when no handle definition is provided""" + v = replace_credential({ + "c": f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}' + }, None) + # Should remain unchanged because no input_def is provided + self.assertEqual(v.get("c"), f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}') def test_credential_in_other_string(self): """Test credential pattern inside other string (should not be replaced)""" diff --git a/oocana/tests/test_handle.py b/oocana/tests/test_handle.py index 790a817a..f3919dab 100644 --- a/oocana/tests/test_handle.py +++ b/oocana/tests/test_handle.py @@ -97,6 +97,7 @@ def input_handle_test(self, input_def: InputHandleDef, expected: InputHandleTest self.assertEqual(input_def.is_serializable_var(), expected["is_serializable_var"]) self.assertEqual(input_def.value, expected["value"]) self.assertEqual(input_def.has_value(), expected["has_value"]) + self.assertEqual(input_def.is_credential_handle(), expected["is_credential_handle"] if "is_credential_handle" in expected else False) def output_handle_test(self, output_def: OutputHandleDef, expected: OutputHandleTestResult): self.handle_test(output_def, expected)