Fixed imports
This commit is contained in:
@@ -25,12 +25,10 @@ import subprocess
|
||||
import sys
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import Any, Generator, Optional
|
||||
|
||||
from playwright.sync_api import BrowserContext, Page
|
||||
|
||||
|
||||
from enum import Enum
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
|
||||
class AuthType(Enum):
|
||||
@@ -101,7 +99,7 @@ type = {config.auth_type.value}
|
||||
f.write("htpasswd_encryption = plain\n")
|
||||
|
||||
f.write(
|
||||
f"""[web]
|
||||
"""[web]
|
||||
type = internal
|
||||
[headers]
|
||||
Content-Security-Policy = default-src 'self'; object-src 'none'
|
||||
@@ -172,9 +170,6 @@ max:maxpassword
|
||||
process.wait()
|
||||
|
||||
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
|
||||
def login(
|
||||
page: Page,
|
||||
radicale_server: str,
|
||||
|
||||
@@ -24,14 +24,9 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE, Config, login,
|
||||
start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -41,7 +36,9 @@ def radicale_server(
|
||||
yield from start_radicale_server(tmp_path, config)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
||||
@pytest.mark.parametrize(
|
||||
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||
)
|
||||
def test_index_html_loads(page: Page, radicale_server: str, config: Config) -> None:
|
||||
"""Test that the index.html loads from the server."""
|
||||
console_msgs: list[str] = []
|
||||
@@ -53,7 +50,9 @@ def test_index_html_loads(page: Page, radicale_server: str, config: Config) -> N
|
||||
assert len(errors) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
||||
@pytest.mark.parametrize(
|
||||
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||
)
|
||||
def test_user_login_works(
|
||||
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
||||
) -> None:
|
||||
|
||||
@@ -24,15 +24,9 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
create_collection,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE, Config, create_collection,
|
||||
login, start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -42,7 +36,9 @@ def radicale_server(
|
||||
yield from start_radicale_server(tmp_path, config)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
||||
@pytest.mark.parametrize(
|
||||
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||
)
|
||||
def test_delete_wrong_confirmation(
|
||||
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
||||
) -> None:
|
||||
@@ -68,7 +64,9 @@ def test_delete_wrong_confirmation(
|
||||
expect(page.locator("#deleteconfirmationscene")).to_be_visible()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
||||
@pytest.mark.parametrize(
|
||||
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||
)
|
||||
def test_delete_correct_confirmation(
|
||||
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
||||
) -> None:
|
||||
|
||||
@@ -18,19 +18,15 @@
|
||||
Integration tests for download page
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
from typing import Any, Generator
|
||||
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE, Config, login,
|
||||
start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
|
||||
@@ -24,15 +24,9 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
create_collection,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE, Config, create_collection,
|
||||
login, start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
|
||||
@@ -24,15 +24,9 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
create_collection,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE, Config, create_collection,
|
||||
login, start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
|
||||
@@ -24,13 +24,8 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
Config,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD, Config,
|
||||
login, start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture(params=[SHARING_HTPASSWD, NOSHARE_HTPASSWD], ids=lambda c: c.name)
|
||||
|
||||
@@ -24,14 +24,9 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
create_collection,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (SHARING_HTPASSWD, SHARING_XREMOTE, Config,
|
||||
create_collection, login,
|
||||
start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture(params=[SHARING_HTPASSWD, SHARING_XREMOTE], ids=lambda c: c.name)
|
||||
|
||||
@@ -24,12 +24,8 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
SHARING_HTPASSWD,
|
||||
create_collection,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (SHARING_HTPASSWD, create_collection, login,
|
||||
start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -25,14 +25,9 @@ from typing import Any, Generator
|
||||
import pytest
|
||||
from playwright.sync_api import BrowserContext, Page, expect
|
||||
|
||||
from integ_tests.common import (
|
||||
NOSHARE_HTPASSWD,
|
||||
SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE,
|
||||
Config,
|
||||
login,
|
||||
start_radicale_server,
|
||||
)
|
||||
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||
SHARING_XREMOTE, Config, login,
|
||||
start_radicale_server)
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
|
||||
Reference in New Issue
Block a user