From 5e79e0a7708b72e92a1f0ec1b6127bb127124217 Mon Sep 17 00:00:00 2001 From: Robert Wikman Date: Sat, 7 Nov 2020 01:33:58 +0100 Subject: [PATCH] Update import paths --- examples/table/read/journal.py | 2 +- examples/table/read/nested.py | 3 +-- tests/conftest.py | 7 +------ tests/fields/test_fields_boolean.py | 2 +- tests/fields/test_fields_datetime.py | 2 +- tests/query.py | 2 +- tests/request/test_request_get.py | 10 +++++----- 7 files changed, 11 insertions(+), 17 deletions(-) diff --git a/examples/table/read/journal.py b/examples/table/read/journal.py index 812f608..f67dfb8 100644 --- a/examples/table/read/journal.py +++ b/examples/table/read/journal.py @@ -1,4 +1,4 @@ -from aiosnow import fields, select +from aiosnow import select, fields from aiosnow.models.table.declared import IncidentModel as Incident, JournalModel diff --git a/examples/table/read/nested.py b/examples/table/read/nested.py index 63734d4..f27260c 100644 --- a/examples/table/read/nested.py +++ b/examples/table/read/nested.py @@ -1,6 +1,5 @@ -from aiosnow import fields, select +from aiosnow import select, ModelSchema, fields from aiosnow.models.table.declared import IncidentModel -from aiosnow.models.common.schema import ModelSchema class AssignmentGroup(ModelSchema): diff --git a/tests/conftest.py b/tests/conftest.py index af5896b..2ba8d63 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,15 +3,10 @@ import pytest from aiohttp import web -from aiosnow.client import Client -from aiosnow.models.common import BaseModel, fields +from aiosnow import fields, Client from aiosnow.request.response import Response -class TestModel(BaseModel): - pass - - TEST_TCP_ADDRESS = "127.0.0.1" diff --git a/tests/fields/test_fields_boolean.py b/tests/fields/test_fields_boolean.py index 52ffbe9..d04871f 100644 --- a/tests/fields/test_fields_boolean.py +++ b/tests/fields/test_fields_boolean.py @@ -1,7 +1,7 @@ import marshmallow import pytest -from aiosnow.models import fields +from aiosnow import fields from aiosnow.query.utils import select diff --git a/tests/fields/test_fields_datetime.py b/tests/fields/test_fields_datetime.py index 69efd0a..eff2c03 100644 --- a/tests/fields/test_fields_datetime.py +++ b/tests/fields/test_fields_datetime.py @@ -1,7 +1,7 @@ import marshmallow import pytest -from aiosnow.models import fields +from aiosnow import fields from aiosnow.query.utils import select diff --git a/tests/query.py b/tests/query.py index 02a0156..cdf212d 100644 --- a/tests/query.py +++ b/tests/query.py @@ -1,4 +1,4 @@ -from aiosnow import ModelSchema, TableModel, fields, select +from aiosnow import ModelSchema, TableModel, select, fields def test_query_single(): diff --git a/tests/request/test_request_get.py b/tests/request/test_request_get.py index 9967c98..e0b7350 100644 --- a/tests/request/test_request_get.py +++ b/tests/request/test_request_get.py @@ -19,21 +19,21 @@ async def test_core_get_params_query(mock_session): query = "k1=v1^k2=v2" session = await mock_session(server_method="GET", server_path="/test") request = GetRequest(api_url="/test", session=session, query=query) - assert request.url_params["sysparm_query"] == query + assert request.params["sysparm_query"] == query async def test_core_get_params_limit(mock_session): limit = 15 session = await mock_session(server_method="GET", server_path="/test") request = GetRequest(api_url="/test", session=session, limit=limit) - assert request.url_params["sysparm_limit"] == limit + assert request.params["sysparm_limit"] == limit async def test_core_params_offset(mock_session): offset = 20 session = await mock_session(server_method="GET", server_path="/test") request = GetRequest(api_url="/test", session=session, offset=offset) - assert request.url_params["sysparm_offset"] == offset + assert request.params["sysparm_offset"] == offset async def test_core_get_params_page(mock_session): @@ -41,5 +41,5 @@ async def test_core_get_params_page(mock_session): offset = 10 session = await mock_session(server_method="GET", server_path="/test") request = GetRequest(api_url="/test", session=session, limit=limit, offset=offset) - assert request.url_params["sysparm_limit"] == limit + offset - assert request.url_params["sysparm_offset"] == offset + assert request.params["sysparm_limit"] == limit + offset + assert request.params["sysparm_offset"] == offset