@@ -34,30 +34,6 @@ def mock_ydoc(self):
3434 ydoc .awareness .set_local_state_field = MagicMock ()
3535 return ydoc
3636
37- @pytest .mark .asyncio
38- async def test_no_user_skips_awareness (self , mock_user_dict ):
39- """Test that decorator skips awareness when user is None."""
40-
41- # Create a test function
42- @collaborative_tool (user = None )
43- async def test_func (file_path : str , content : str ):
44- return f"processed { file_path } with { content } "
45-
46- # Mock the awareness functions to ensure they're not called
47- with patch ('jupyter_ai_tools.utils.get_global_awareness' ) as mock_global , \
48- patch ('jupyter_ai_tools.utils.get_file_id' ) as mock_file_id , \
49- patch ('jupyter_ai_tools.utils.get_jupyter_ydoc' ) as mock_ydoc :
50-
51- result = await test_func ("test.ipynb" , "test content" )
52-
53- # Verify function executed normally
54- assert result == "processed test.ipynb with test content"
55-
56- # Verify awareness functions were never called
57- mock_global .assert_not_called ()
58- mock_file_id .assert_not_called ()
59- mock_ydoc .assert_not_called ()
60-
6137 @pytest .mark .asyncio
6238 async def test_user_with_notebook_file_sets_awareness (self , mock_user_dict , mock_global_awareness , mock_ydoc ):
6339 """Test that decorator sets both global and notebook awareness for .ipynb files."""
0 commit comments