Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
smathot committed Apr 18, 2024
1 parent 2761c64 commit c49e948
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/cheap/test_api_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ def setUp(self):
self.login()

def test_new_conversation(self):
# Add some content to the conversation to make it count
self.client.post('/api/setting/set', json={'search_first': 'false'})
response = self.client.post('/api/chat/start', json={
'message': 'dummy'
})
for response in self.client.get('/api/chat/stream').iter_encoded():
pass
response = self.client.get('/api/conversation/list')
original_count = len(response.json)
response = self.client.get('/api/conversation/new',
Expand All @@ -26,6 +33,13 @@ def test_clear_conversation(self):
self.assertEqual(response.status_code, 200)

def test_delete_conversation(self):
# Add some content to the conversation to make it count
self.client.post('/api/setting/set', json={'search_first': 'false'})
response = self.client.post('/api/chat/start', json={
'message': 'dummy'
})
for response in self.client.get('/api/chat/stream').iter_encoded():
pass
self.client.get('/api/conversation/new', follow_redirects=True)
list_resp = self.client.get('/api/conversation/list')
conversation_id = list(list_resp.json)[0]
Expand Down

0 comments on commit c49e948

Please sign in to comment.