@@ -44,19 +44,16 @@ async def test_view_note_basic_functionality(app, test_project):
4444 # View the note
4545 result = await view_note .fn ("Test View Note" , project = test_project .name )
4646
47- # Should contain artifact XML
48- assert '<artifact identifier="note- ' in result
49- assert 'type="text/ markdown"' in result
50- assert 'title="Test View Note"' in result
51- assert "</artifact> " in result
47+ # Should contain note retrieval message
48+ assert 'Note retrieved: "Test View Note" ' in result
49+ assert "Display this note as a markdown artifact for the user" in result
50+ assert "Content:" in result
51+ assert "--- " in result
5252
53- # Should contain the note content within the artifact
53+ # Should contain the note content
5454 assert "# Test View Note" in result
5555 assert "This is test content for viewing." in result
5656
57- # Should have confirmation message
58- assert "✅ Note displayed as artifact" in result
59-
6057
6158@pytest .mark .asyncio
6259async def test_view_note_with_frontmatter_title (app , test_project ):
@@ -80,9 +77,9 @@ async def test_view_note_with_frontmatter_title(app, test_project):
8077 # View the note
8178 result = await view_note .fn ("Frontmatter Title" , project = test_project .name )
8279
83- # Should extract title from frontmatter
84- assert 'title= "Frontmatter Title"' in result
85- assert "✅ Note displayed as artifact: **Frontmatter Title** " in result
80+ # Should show title in retrieval message
81+ assert 'Note retrieved: "Frontmatter Title"' in result
82+ assert "Display this note as a markdown artifact for the user " in result
8683
8784
8885@pytest .mark .asyncio
@@ -98,9 +95,9 @@ async def test_view_note_with_heading_title(app, test_project):
9895 # View the note
9996 result = await view_note .fn ("Heading Title" , project = test_project .name )
10097
101- # Should extract title from heading
102- assert 'title= "Heading Title"' in result
103- assert "✅ Note displayed as artifact: **Heading Title** " in result
98+ # Should show title in retrieval message
99+ assert 'Note retrieved: "Heading Title"' in result
100+ assert "Display this note as a markdown artifact for the user " in result
104101
105102
106103@pytest .mark .asyncio
@@ -119,7 +116,7 @@ async def test_view_note_unicode_content(app, test_project):
119116 assert "🚀" in result
120117 assert "🎉" in result
121118 assert "♠♣♥♦" in result
122- assert '<artifact identifier="note- ' in result
119+ assert 'Note retrieved: "Unicode Test 🚀" ' in result
123120
124121
125122@pytest .mark .asyncio
@@ -136,9 +133,9 @@ async def test_view_note_by_permalink(app, test_project):
136133 result = await view_note .fn ("test/permalink-test" , project = test_project .name )
137134
138135 # Should work with permalink
139- assert '<artifact identifier="note- ' in result
136+ assert 'Note retrieved: "test/permalink-test" ' in result
140137 assert "Content for permalink test." in result
141- assert "✅ Note displayed as artifact" in result
138+ assert "Display this note as a markdown artifact for the user " in result
142139
143140
144141@pytest .mark .asyncio
@@ -155,9 +152,9 @@ async def test_view_note_with_memory_url(app, test_project):
155152 result = await view_note .fn ("memory://test/memory-url-test" , project = test_project .name )
156153
157154 # Should work with memory:// URL
158- assert '<artifact identifier="note- ' in result
155+ assert 'Note retrieved: "memory://test/memory-url-test" ' in result
159156 assert "Testing memory:// URL handling in view_note" in result
160- assert "✅ Note displayed as artifact" in result
157+ assert "Display this note as a markdown artifact for the user " in result
161158
162159
163160@pytest .mark .asyncio
@@ -166,10 +163,10 @@ async def test_view_note_not_found(app, test_project):
166163 # Try to view non-existent note
167164 result = await view_note .fn ("NonExistent Note" , project = test_project .name )
168165
169- # Should return error message without artifact
166+ # Should return error message without artifact instructions
170167 assert "# Note Not Found" in result
171168 assert "NonExistent Note" in result
172- assert "< artifact" not in result # No artifact for errors
169+ assert "Display this note as a markdown artifact" not in result # No artifact for errors
173170 assert "Check Identifier Type" in result
174171 assert "Search Instead" in result
175172
@@ -188,9 +185,9 @@ async def test_view_note_pagination(app, test_project):
188185 result = await view_note .fn ("Pagination Test" , page = 1 , page_size = 5 , project = test_project .name )
189186
190187 # Should work with pagination
191- assert '<artifact identifier="note- ' in result
188+ assert 'Note retrieved: "Pagination Test" ' in result
192189 assert "Content for pagination test." in result
193- assert "✅ Note displayed as artifact" in result
190+ assert "Display this note as a markdown artifact for the user " in result
194191
195192
196193@pytest .mark .asyncio
@@ -207,14 +204,14 @@ async def test_view_note_project_parameter(app, test_project):
207204 result = await view_note .fn ("Project Test" , project = test_project .name )
208205
209206 # Should work with project parameter
210- assert '<artifact identifier="note- ' in result
207+ assert 'Note retrieved: "Project Test" ' in result
211208 assert "Content for project test." in result
212- assert "✅ Note displayed as artifact" in result
209+ assert "Display this note as a markdown artifact for the user " in result
213210
214211
215212@pytest .mark .asyncio
216213async def test_view_note_artifact_identifier_unique (app , test_project ):
217- """Test that different notes get different artifact identifiers."""
214+ """Test that different notes are retrieved correctly with unique identifiers."""
218215 # Create two notes
219216 await write_note .fn (
220217 project = test_project .name , title = "Note One" , folder = "test" , content = "Content one"
@@ -227,15 +224,11 @@ async def test_view_note_artifact_identifier_unique(app, test_project):
227224 result1 = await view_note .fn ("Note One" , project = test_project .name )
228225 result2 = await view_note .fn ("Note Two" , project = test_project .name )
229226
230- # Should have different artifact identifiers
231- import re
232-
233- id1_match = re .search (r'identifier="(note-\d+)"' , result1 )
234- id2_match = re .search (r'identifier="(note-\d+)"' , result2 )
235-
236- assert id1_match is not None
237- assert id2_match is not None
238- assert id1_match .group (1 ) != id2_match .group (1 )
227+ # Should have different note identifiers in retrieval messages
228+ assert 'Note retrieved: "Note One"' in result1
229+ assert 'Note retrieved: "Note Two"' in result2
230+ assert "Content one" in result1
231+ assert "Content two" in result2
239232
240233
241234@pytest .mark .asyncio
@@ -252,9 +245,9 @@ async def test_view_note_fallback_identifier_as_title(app, test_project):
252245 # View the note
253246 result = await view_note .fn ("Simple Note" , project = test_project .name )
254247
255- # Should use identifier as fallback title
256- assert 'title= "Simple Note"' in result
257- assert "✅ Note displayed as artifact: **Simple Note** " in result
248+ # Should use identifier as title in retrieval message
249+ assert 'Note retrieved: "Simple Note"' in result
250+ assert "Display this note as a markdown artifact for the user " in result
258251
259252
260253@pytest .mark .asyncio
@@ -282,8 +275,7 @@ async def test_view_note_direct_success(app, test_project, mock_call_get):
282275 mock_call_get .assert_called_once ()
283276 assert "test/test-note" in mock_call_get .call_args [0 ][1 ]
284277
285- # Verify result contains artifact
286- assert '<artifact identifier="note- ' in result
287- assert 'title="Test Note"' in result
278+ # Verify result contains note content
279+ assert 'Note retrieved: "test/test-note" ' in result
280+ assert "Display this note as a markdown artifact for the user" in result
288281 assert "This is a test note." in result
289- assert "✅ Note displayed as artifact: **Test Note**" in result
0 commit comments