Skip to content

Commit

Permalink
Update import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rbw committed Nov 7, 2020
1 parent 135c6b0 commit 5e79e0a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/table/read/journal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from aiosnow import fields, select
from aiosnow import select, fields
from aiosnow.models.table.declared import IncidentModel as Incident, JournalModel


Expand Down
3 changes: 1 addition & 2 deletions examples/table/read/nested.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
7 changes: 1 addition & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
2 changes: 1 addition & 1 deletion tests/fields/test_fields_boolean.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import marshmallow
import pytest

from aiosnow.models import fields
from aiosnow import fields
from aiosnow.query.utils import select


Expand Down
2 changes: 1 addition & 1 deletion tests/fields/test_fields_datetime.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import marshmallow
import pytest

from aiosnow.models import fields
from aiosnow import fields
from aiosnow.query.utils import select


Expand Down
2 changes: 1 addition & 1 deletion tests/query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from aiosnow import ModelSchema, TableModel, fields, select
from aiosnow import ModelSchema, TableModel, select, fields


def test_query_single():
Expand Down
10 changes: 5 additions & 5 deletions tests/request/test_request_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ 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):
limit = 15
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

0 comments on commit 5e79e0a

Please sign in to comment.