test: Replace unittest class with simple tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"""Interactive integration tests for OAuth authentication."""
|
"""Interactive integration tests for OAuth authentication."""
|
||||||
|
|
||||||
import os
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@ logger = logging.getLogger(__name__)
|
|||||||
pytestmark = [pytest.mark.integration, pytest.mark.oauth]
|
pytestmark = [pytest.mark.integration, pytest.mark.oauth]
|
||||||
|
|
||||||
|
|
||||||
class TestOAuthPlaywright:
|
async def test_playwright_oauth_token_acquisition(playwright_oauth_token: str):
|
||||||
"""Test automated Playwright OAuth authentication."""
|
|
||||||
|
|
||||||
async def test_playwright_oauth_token_acquisition(
|
|
||||||
self, playwright_oauth_token: str
|
|
||||||
):
|
|
||||||
"""Test that Playwright can acquire an OAuth token automatically."""
|
"""Test that Playwright can acquire an OAuth token automatically."""
|
||||||
assert playwright_oauth_token is not None
|
assert playwright_oauth_token is not None
|
||||||
assert isinstance(playwright_oauth_token, str)
|
assert isinstance(playwright_oauth_token, str)
|
||||||
@@ -23,7 +18,8 @@ class TestOAuthPlaywright:
|
|||||||
f"Successfully acquired OAuth token via Playwright: {playwright_oauth_token[:20]}..."
|
f"Successfully acquired OAuth token via Playwright: {playwright_oauth_token[:20]}..."
|
||||||
)
|
)
|
||||||
|
|
||||||
async def test_oauth_client_with_playwright_flow(self, nc_oauth_client_playwright):
|
|
||||||
|
async def test_oauth_client_with_playwright_flow(nc_oauth_client_playwright):
|
||||||
"""Test that OAuth client created via Playwright flow can access Nextcloud APIs."""
|
"""Test that OAuth client created via Playwright flow can access Nextcloud APIs."""
|
||||||
# Test 1: Check capabilities
|
# Test 1: Check capabilities
|
||||||
capabilities = await nc_oauth_client_playwright.capabilities()
|
capabilities = await nc_oauth_client_playwright.capabilities()
|
||||||
@@ -35,9 +31,8 @@ class TestOAuthPlaywright:
|
|||||||
assert isinstance(notes, list)
|
assert isinstance(notes, list)
|
||||||
logger.info(f"OAuth client (Playwright) successfully listed {len(notes)} notes")
|
logger.info(f"OAuth client (Playwright) successfully listed {len(notes)} notes")
|
||||||
|
|
||||||
async def test_mcp_oauth_client_with_playwright(
|
|
||||||
self, nc_mcp_oauth_client_playwright
|
async def test_mcp_oauth_client_with_playwright(nc_mcp_oauth_client_playwright):
|
||||||
):
|
|
||||||
"""Test that MCP OAuth client via Playwright can execute tools."""
|
"""Test that MCP OAuth client via Playwright can execute tools."""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user