refactor: Create admin enpoints and some renaming of api endpoints
This commit is contained in:
@@ -50,7 +50,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_credit_service] = lambda: mock_credit_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/play/1")
|
||||
response = await authenticated_client.post("/api/v1/sounds/play/1")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -89,7 +89,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_credit_service] = lambda: mock_credit_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/play/999")
|
||||
response = await authenticated_client.post("/api/v1/sounds/play/999")
|
||||
|
||||
assert response.status_code == 404
|
||||
data = response.json()
|
||||
@@ -136,7 +136,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_credit_service] = lambda: mock_credit_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/play/1")
|
||||
response = await authenticated_client.post("/api/v1/sounds/play/1")
|
||||
|
||||
assert response.status_code == 500
|
||||
data = response.json()
|
||||
@@ -169,7 +169,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_credit_service] = lambda: mock_credit_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/play/1")
|
||||
response = await authenticated_client.post("/api/v1/sounds/play/1")
|
||||
|
||||
assert response.status_code == 500
|
||||
data = response.json()
|
||||
@@ -186,7 +186,7 @@ class TestVLCEndpoints:
|
||||
client: AsyncClient,
|
||||
) -> None:
|
||||
"""Test VLC playback without authentication."""
|
||||
response = await client.post("/api/v1/sounds/vlc/play/1")
|
||||
response = await client.post("/api/v1/sounds/play/1")
|
||||
assert response.status_code == 401
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -212,7 +212,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_vlc_player] = lambda: mock_vlc_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await authenticated_client.post("/api/v1/sounds/stop")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -250,7 +250,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_vlc_player] = lambda: mock_vlc_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await authenticated_client.post("/api/v1/sounds/stop")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -285,7 +285,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_vlc_player] = lambda: mock_vlc_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await authenticated_client.post("/api/v1/sounds/stop")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -320,7 +320,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_vlc_player] = lambda: mock_vlc_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await authenticated_client.post("/api/v1/sounds/stop")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -347,7 +347,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_vlc_player] = lambda: mock_vlc_service
|
||||
|
||||
try:
|
||||
response = await authenticated_client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await authenticated_client.post("/api/v1/sounds/stop")
|
||||
|
||||
assert response.status_code == 500
|
||||
data = response.json()
|
||||
@@ -362,7 +362,7 @@ class TestVLCEndpoints:
|
||||
client: AsyncClient,
|
||||
) -> None:
|
||||
"""Test stopping VLC instances without authentication."""
|
||||
response = await client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await client.post("/api/v1/sounds/stop")
|
||||
assert response.status_code == 401
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -401,7 +401,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_credit_service] = lambda: mock_credit_service
|
||||
|
||||
try:
|
||||
response = await authenticated_admin_client.post("/api/v1/sounds/vlc/play/1")
|
||||
response = await authenticated_admin_client.post("/api/v1/sounds/play/1")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -427,7 +427,7 @@ class TestVLCEndpoints:
|
||||
test_app.dependency_overrides[get_vlc_player] = lambda: mock_vlc_service_2
|
||||
|
||||
try:
|
||||
response = await authenticated_admin_client.post("/api/v1/sounds/vlc/stop-all")
|
||||
response = await authenticated_admin_client.post("/api/v1/sounds/stop")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
|
||||
Reference in New Issue
Block a user