Skip to content

Commit fce1df8

Browse files
committed
Fix for test_remote_control_endpoints_comprehensive failure on github
1 parent 0a4c0c8 commit fce1df8

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

tests/test_remote_api.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,22 @@ def test_remote_control_endpoints_comprehensive(self, client):
132132
assert data['success'] == True
133133

134134
# Test 3: Favorite load with nonexistent ID
135-
response = client.post('/api/favorites/test-id/load')
136-
assert response.status_code == 404
135+
# Create empty favorites.json file to ensure we get "Favorite not found" instead of "No favorites found"
136+
import os
137+
with open('favorites.json', 'w') as f:
138+
json.dump({}, f)
137139

138-
data = json.loads(response.data)
139-
assert 'error' in data
140-
assert 'Favorite not found' in data['error']
140+
try:
141+
response = client.post('/api/favorites/test-id/load')
142+
assert response.status_code == 404
143+
144+
data = json.loads(response.data)
145+
assert 'error' in data
146+
assert 'Favorite not found' in data['error']
147+
finally:
148+
# Clean up test file
149+
if os.path.exists('favorites.json'):
150+
os.remove('favorites.json')
141151

142152
# Test 4: Request queue endpoints
143153
# Save favorite request polling

0 commit comments

Comments
 (0)