Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions executor/tests/test_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)"""
Expand Down
1 change: 1 addition & 0 deletions oocana/tests/test_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading