Skip to content

Commit

Permalink
imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Morgan committed Oct 28, 2024
1 parent 2acf4c4 commit 3bd849c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 19 deletions.
1 change: 0 additions & 1 deletion tests/integration/client/test_active_user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api.client import SpeckleClient
from specklepy.api.models import Activity, ActivityCollection, User
Expand Down
1 change: 0 additions & 1 deletion tests/integration/client/test_branch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api import operations
from specklepy.api.models import Branch, Commit, Stream
Expand Down
1 change: 0 additions & 1 deletion tests/integration/client/test_commit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api import operations
from specklepy.api.models import Commit, Stream
Expand Down
1 change: 0 additions & 1 deletion tests/integration/client/test_objects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api.models import Stream
from specklepy.objects import Base
Expand Down
1 change: 0 additions & 1 deletion tests/integration/client/test_other_user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api.client import SpeckleClient
from specklepy.api.models import Activity, ActivityCollection, LimitedUser
Expand Down
1 change: 0 additions & 1 deletion tests/integration/client/test_stream.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api.client import SpeckleClient
from specklepy.api.models import (
Expand Down
1 change: 0 additions & 1 deletion tests/integration/client/test_user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from deprecated import deprecated

from specklepy.api.client import SpeckleClient
from specklepy.api.models import Activity, ActivityCollection, User
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/client/test_version_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 11 additions & 10 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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",
Expand All @@ -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)]
Expand Down

0 comments on commit 3bd849c

Please sign in to comment.