@@ -53,23 +53,23 @@ def test_extensions_ref_with_load_public_skills():
5353 # Verify the constant is set correctly
5454 assert PUBLIC_SKILLS_BRANCH == "test-branch"
5555
56- # Mock the actual git operations to avoid needing a real clone
56+ # Mock the actual git operations and verify branch is passed
5757 with mock .patch (
58- "openhands.sdk.context.skills.utils .update_skills_repository"
58+ "openhands.sdk.context.skills.skill .update_skills_repository"
5959 ) as mock_update :
6060 mock_update .return_value = (
6161 None # Simulate failed clone (expected behavior for test)
6262 )
6363
64- # This should use test-branch internally
65- # We expect it to fail/return empty since we're mocking the repo update
66- try :
67- skills = load_public_skills ()
68- # If it succeeds, it should be an empty list since we mocked the update
69- assert isinstance ( skills , list )
70- except Exception :
71- # Expected if the mock doesn't perfectly simulate the environment
72- pass
64+ load_public_skills ()
65+
66+ # Verify the branch was passed to update_skills_repository
67+ mock_update . assert_called_once ()
68+ call_args = mock_update . call_args
69+ # branch is 2nd positional arg: (repo_url, branch, cache_dir )
70+ assert call_args [ 0 ][ 1 ] == "test-branch" , (
71+ f" Expected branch='test-branch' but got { call_args [ 0 ][ 1 ] } "
72+ )
7373
7474
7575def test_extensions_ref_empty_string ():
0 commit comments