From 3bd849c815766d107c50d03bc3e3567b8e4227d6 Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:28:30 +0000 Subject: [PATCH] imports --- tests/integration/client/test_active_user.py | 1 - tests/integration/client/test_branch.py | 1 - tests/integration/client/test_commit.py | 1 - tests/integration/client/test_objects.py | 1 - tests/integration/client/test_other_user.py | 1 - tests/integration/client/test_stream.py | 1 - tests/integration/client/test_user.py | 1 - .../client/test_version_resource.py | 3 +-- tests/integration/conftest.py | 21 ++++++++++--------- 9 files changed, 12 insertions(+), 19 deletions(-) diff --git a/tests/integration/client/test_active_user.py b/tests/integration/client/test_active_user.py index 3e946528..7f35139c 100644 --- a/tests/integration/client/test_active_user.py +++ b/tests/integration/client/test_active_user.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api.client import SpeckleClient from specklepy.api.models import Activity, ActivityCollection, User diff --git a/tests/integration/client/test_branch.py b/tests/integration/client/test_branch.py index 075ae9f7..27bf8ba4 100644 --- a/tests/integration/client/test_branch.py +++ b/tests/integration/client/test_branch.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api import operations from specklepy.api.models import Branch, Commit, Stream diff --git a/tests/integration/client/test_commit.py b/tests/integration/client/test_commit.py index 4a664d40..9ce3c815 100644 --- a/tests/integration/client/test_commit.py +++ b/tests/integration/client/test_commit.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api import operations from specklepy.api.models import Commit, Stream diff --git a/tests/integration/client/test_objects.py b/tests/integration/client/test_objects.py index 7c07b149..f921ee66 100644 --- a/tests/integration/client/test_objects.py +++ b/tests/integration/client/test_objects.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api.models import Stream from specklepy.objects import Base diff --git a/tests/integration/client/test_other_user.py b/tests/integration/client/test_other_user.py index 9394e197..9061b11f 100644 --- a/tests/integration/client/test_other_user.py +++ b/tests/integration/client/test_other_user.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api.client import SpeckleClient from specklepy.api.models import Activity, ActivityCollection, LimitedUser diff --git a/tests/integration/client/test_stream.py b/tests/integration/client/test_stream.py index 87f5b729..84ce5f7e 100644 --- a/tests/integration/client/test_stream.py +++ b/tests/integration/client/test_stream.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api.client import SpeckleClient from specklepy.api.models import ( diff --git a/tests/integration/client/test_user.py b/tests/integration/client/test_user.py index a87ae6de..58859852 100644 --- a/tests/integration/client/test_user.py +++ b/tests/integration/client/test_user.py @@ -1,5 +1,4 @@ import pytest -from deprecated import deprecated from specklepy.api.client import SpeckleClient from specklepy.api.models import Activity, ActivityCollection, User diff --git a/tests/integration/client/test_version_resource.py b/tests/integration/client/test_version_resource.py index ce7fdbd1..e0ec7b52 100644 --- a/tests/integration/client/test_version_resource.py +++ b/tests/integration/client/test_version_resource.py @@ -12,8 +12,7 @@ UpdateVersionInput, ) from specklepy.core.api.models import Model, Project, Version -from specklepy.core.api.new_models import ModelWithVersions -from specklepy.core.api.responses import ResourceCollection +from specklepy.core.api.new_models import ModelWithVersions, ResourceCollection from specklepy.logging.exceptions import GraphQLException from specklepy.objects.base import Base from specklepy.transports.server.server import ServerTransport diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index b61d8e21..a9d2f922 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -1,12 +1,13 @@ import random import uuid +from typing import Dict from urllib.parse import parse_qs, urlparse import pytest import requests -from specklepy.api.client import SpeckleClient -from specklepy.api.models import Stream +from specklepy.core.api.client import SpeckleClient +from specklepy.core.api.models import Stream from specklepy.logging import metrics from specklepy.objects.base import Base from specklepy.objects.fakemesh import FakeDirection, FakeMesh @@ -16,11 +17,11 @@ @pytest.fixture(scope="session") -def host(): +def host() -> str: return "localhost:3000" -def seed_user(host): +def seed_user(host: str) -> Dict[str, str]: seed = uuid.uuid4().hex user_dict = { "email": f"{seed[0:7]}@example.org", @@ -58,17 +59,17 @@ def seed_user(host): @pytest.fixture(scope="session") -def user_dict(host): +def user_dict(host: str) -> Dict[str, str]: return seed_user(host) @pytest.fixture(scope="session") -def second_user_dict(host): +def second_user_dict(host: str) -> Dict[str, str]: return seed_user(host) @pytest.fixture(scope="session") -def client(host, user_dict): +def client(host: str, user_dict: Dict[str, str]) -> SpeckleClient: client = SpeckleClient(host=host, use_ssl=False) client.authenticate_with_token(user_dict["token"]) user = client.active_user.get() @@ -82,7 +83,7 @@ def client(host, user_dict): @pytest.fixture(scope="session") -def second_client(host, second_user_dict): +def second_client(host: str, second_user_dict: Dict[str, str]): client = SpeckleClient(host=host, use_ssl=False) client.authenticate_with_token(second_user_dict["token"]) user = client.active_user.get() @@ -96,7 +97,7 @@ def second_client(host, second_user_dict): @pytest.fixture(scope="session") -def sample_stream(client): +def sample_stream(client: SpeckleClient) -> Stream: stream = Stream( name="a sample stream for testing", description="a stream created for testing", @@ -107,7 +108,7 @@ def sample_stream(client): @pytest.fixture(scope="session") -def mesh(): +def mesh() -> FakeMesh: mesh = FakeMesh() mesh.name = "my_mesh" mesh.vertices = [random.uniform(0, 10) for _ in range(1, 210)]