diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-23 20:59:47 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-23 20:59:47 -0700 |
commit | f13a9c26c7a894703b401f4898b3d5bb84282824 (patch) | |
tree | 072e7cfd33cc2d2ecb501119aef0f2e982012e0d /tests | |
parent | 176c76597dd42705cf3aaf307b831cb5f979d9bb (diff) | |
download | fatcat-f13a9c26c7a894703b401f4898b3d5bb84282824.tar.gz fatcat-f13a9c26c7a894703b401f4898b3d5bb84282824.zip |
pylinting
Diffstat (limited to 'tests')
-rw-r--r-- | tests/api.py | 14 | ||||
-rw-r--r-- | tests/entity_lifecycle.py | 2 | ||||
-rw-r--r-- | tests/fixtures.py | 4 | ||||
-rw-r--r-- | tests/models.py | 4 | ||||
-rw-r--r-- | tests/routes.py | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/tests/api.py b/tests/api.py index 7e487f17..bb7007c1 100644 --- a/tests/api.py +++ b/tests/api.py @@ -1,8 +1,8 @@ import json -import pytest import unittest import tempfile +import pytest import fatcat import fatcat.sql from fatcat.models import * @@ -196,18 +196,18 @@ def test_api_rich_create(app): # Test that foreign key relations worked release_rv = json.loads(app.get('/v0/release/{}'.format(release_id)).data.decode('utf-8')) print(release_rv) - assert(release_rv['creators'][0]['creator'] == creator_id) - assert(release_rv['container']['id'] == container_id) - assert(release_rv['work']['id'] == work_id) - assert(release_rv['refs'][0]['target'] == stub_release_id) + assert release_rv['creators'][0]['creator'] == creator_id + assert release_rv['container']['id'] == container_id + assert release_rv['work']['id'] == work_id + assert release_rv['refs'][0]['target'] == stub_release_id file_rv = json.loads(app.get('/v0/file/{}'.format(file_id)).data.decode('utf-8')) print(file_rv) - assert(file_rv['releases'][0]['release'] == release_id) + assert file_rv['releases'][0]['release'] == release_id # test that editor's active edit group is now invalid editor = Editor.query.first() - assert editor.active_editgroup == None + assert editor.active_editgroup is None def test_api_release_lookup(rich_app): app = rich_app diff --git a/tests/entity_lifecycle.py b/tests/entity_lifecycle.py index 9f5b4040..4ac7ee68 100644 --- a/tests/entity_lifecycle.py +++ b/tests/entity_lifecycle.py @@ -1,8 +1,8 @@ import json -import pytest import unittest import tempfile +import pytest import fatcat import fatcat.sql from fatcat.models import * diff --git a/tests/fixtures.py b/tests/fixtures.py index 30358a5c..d3d8c24b 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -2,8 +2,8 @@ import os import time import json -import pytest import signal +import pytest import fatcat import fatcat.sql from fatcat.models import * @@ -151,7 +151,7 @@ def check_entity_fields(e): def check_release(e): for key in ('work', 'release_type'): assert key in e - for key in ('title'): + for key in ('title', ): assert e[key] is not None for key in ('refs', 'creators'): assert type(e[key]) == list diff --git a/tests/models.py b/tests/models.py index e969992b..98bb6bc7 100644 --- a/tests/models.py +++ b/tests/models.py @@ -1,8 +1,8 @@ import json -import pytest import unittest import tempfile +import pytest import fatcat import fatcat.sql from fatcat.models import * @@ -36,7 +36,7 @@ def test_schema_release_rev(app): model_after = ReleaseRev.query.first() serial = release_rev_schema.dump(model_after).data #check_release(serial) - for k in e.keys(): + for k in e: assert e[k] == serial[k] def test_schema_creator_rev(app): diff --git a/tests/routes.py b/tests/routes.py index d74412b6..5b9f0ca9 100644 --- a/tests/routes.py +++ b/tests/routes.py @@ -1,9 +1,9 @@ import json +import tempfile import pytest import fatcat import fatcat.sql -import tempfile from fatcat.models import * from fixtures import * |