Skip to content

Commit

Permalink
fix: rename get_topics to get_stream_topics
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertRosca committed Oct 12, 2023
1 parent 746b123 commit 271ae8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/zulip_write_only_proxy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def upload_file(


@app.get(
"/get_topics",
"/get_stream_topics",
tags=["User"],
response_description=f"See <a href='{_docs_url}'>{_docs_url}</a>",
)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_upload_file(fastapi_client, zulip_client):
assert uploaded_file.name == "test.jpg"


def test_get_topics(fastapi_client, zulip_client):
def test_get_stream_topics(fastapi_client, zulip_client):
zulip_response_id = {"msg": "", "result": "success", "stream_id": 15}
zulip_response_topics = {
"msg": "",
Expand All @@ -117,17 +117,17 @@ def test_get_topics(fastapi_client, zulip_client):
zulip_client.get_stream_id = MagicMock(return_value=zulip_response_id)
zulip_client.get_stream_topics = MagicMock(return_value=zulip_response_topics)

response = fastapi_client.get("/get_topics")
response = fastapi_client.get("/get_stream_topics")

assert response.status_code == 200
assert response.json() == zulip_response_topics


def test_get_topics_error(fastapi_client, zulip_client):
def test_get_stream_topics_error(fastapi_client, zulip_client):
zulip_response_id = {"result": "error"}
zulip_client.get_stream_id = MagicMock(return_value=zulip_response_id)

response = fastapi_client.get("/get_topics")
response = fastapi_client.get("/get_stream_topics")

assert response.status_code == 200
assert response.json() == {"result": "error"}
Expand Down

0 comments on commit 271ae8d

Please sign in to comment.