[14350] Handling missing use-case in tests

This commit is contained in:
Andrii Kysylevskyi 2025-11-15 01:01:42 +00:00
parent 36fa7ac2ab
commit 747c9df148
3 changed files with 13 additions and 8 deletions

View File

@ -23,10 +23,7 @@ class Task(TaskBase):
class CassandraConnection:
def __init__(self, hosts=None, port=9042):
if hosts is None:
hosts = ["cassandra"]
self.cluster = Cluster(hosts, port=port)
self.cluster = Cluster(hosts or ["cassandra"], port=port)
self.session = None
self.keyspace = "task_manager"

View File

@ -23,10 +23,7 @@ class Task(TaskBase):
class ScyllaDBConnection:
def __init__(self, hosts=None, port=9042):
if hosts is None:
hosts = ["scylladb"]
self.cluster = Cluster(hosts, port=port)
self.cluster = Cluster(hosts or ["scylladb"], port=port)
self.session = None
self.keyspace = "task_manager"

View File

@ -191,6 +191,17 @@ def test_crud_app(client: TestClient):
assert response.status_code == 404, response.text
assert response.json() == snapshot({"detail": "Task not found"})
response = client.put(
f"/tasks/{task_id}",
json={
"title": "Updated non-existent task",
"description": "This should fail",
"status": "pending",
},
)
assert response.status_code == 404, response.text
assert response.json() == snapshot({"detail": "Task not found"})
def test_openapi_schema(client: TestClient):
response = client.get("/openapi.json")