Skip to content

Commit

Permalink
Update test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Melyns authored Sep 12, 2024
1 parent 0f92dbc commit 492e901
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,25 @@
def test_index():
response = client.get("/")
assert response.status_code == 200
assert "Welcome" in response.text
assert "<title>Schizo Bots</title>" in response.text
assert '<button id="pause-button" class="pause-button">Pause</button>' in response.text
assert '<button id="new-chat-button" class="new-chat-button">New Chat</button>' in response.text

def test_new_chat():
# Ensure the chat is not paused before starting a new chat
client.post("/pause")

response = client.post("/new-chat")
assert response.status_code == 200
assert response.json() == {"status": "new chat started"}

def test_pause():
# Check initial pause state
response = client.post("/pause")
assert response.status_code == 200
assert response.json()["paused"] is True

# Toggle pause state back to False
response = client.post("/pause")
assert response.status_code == 200
assert response.json()["paused"] is False

0 comments on commit 492e901

Please sign in to comment.