Skip to content

Commit b434d32

Browse files
committed
isort tests/mocks/utils
1 parent 6b3db69 commit b434d32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+105
-71
lines changed

openlibrary/conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
from infogami.infobase.tests.pytest_wildcard import Wildcard
88
from infogami.utils import template
99
from infogami.utils.view import render_template as infobase_render_template
10-
from openlibrary.i18n import gettext
1110
from openlibrary.core import helpers
12-
11+
from openlibrary.i18n import gettext
12+
from openlibrary.mocks.mock_ia import mock_ia # noqa: F401 side effects may be needed
1313
from openlibrary.mocks.mock_infobase import (
1414
mock_site, # noqa: F401 side effects may be needed
1515
)
16-
from openlibrary.mocks.mock_ia import mock_ia # noqa: F401 side effects may be needed
1716
from openlibrary.mocks.mock_memcache import (
1817
mock_memcache, # noqa: F401 side effects may be needed
1918
)

openlibrary/mocks/mock_ia.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33

44
import pytest
5+
56
from openlibrary.core import ia
67

78

openlibrary/mocks/mock_infobase.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
import itertools
66
import json
77
import re
8+
from datetime import datetime
9+
810
import pytest
911
import web
1012

11-
from datetime import datetime
12-
13-
from infogami.infobase import client, common, account, config as infobase_config
1413
from infogami import config
14+
from infogami.infobase import account, client, common
15+
from infogami.infobase import config as infobase_config
1516
from openlibrary.plugins.upstream.models import Changeset
1617
from openlibrary.plugins.upstream.utils import safeget
1718

18-
1919
key_patterns = {
2020
'work': '/works/OL%dW',
2121
'edition': '/books/OL%dM',

openlibrary/mocks/mock_ol.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import pytest
21
import re
2+
3+
import pytest
34
import web
5+
46
from infogami import config
57
from infogami.utils import delegate
68

@@ -9,7 +11,7 @@
911
except ImportError: # older versions of web.py
1012
from web import AppBrowser
1113

12-
from openlibrary.mocks.mock_infobase import mock_site, MockConnection
14+
from openlibrary.mocks.mock_infobase import MockConnection, mock_site
1315
from openlibrary.plugins import ol_infobase
1416

1517

openlibrary/mocks/tests/test_mock_infobase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
23
import web
34

45

openlibrary/mocks/tests/test_mock_memcache.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from .. import mock_memcache
21
import memcache
32

3+
from .. import mock_memcache
4+
45

56
class Test_mock_memcache:
67
def test_set(self):

openlibrary/tests/accounts/test_models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
from openlibrary.accounts import model, InternetArchiveAccount, OpenLibraryAccount
2-
from requests.models import Response
31
from unittest import mock
42

3+
from requests.models import Response
4+
5+
from openlibrary.accounts import InternetArchiveAccount, OpenLibraryAccount, model
6+
57

68
def get_username(account):
79
return account and account.value

openlibrary/tests/catalog/test_get_ia.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import pytest
21
from pathlib import Path
2+
3+
import pytest
4+
35
from openlibrary.catalog import get_ia
4-
from openlibrary.core import ia
6+
from openlibrary.catalog.marc.marc_binary import BadLength, BadMARC, MarcBinary
57
from openlibrary.catalog.marc.marc_xml import MarcXml
6-
from openlibrary.catalog.marc.marc_binary import MarcBinary, BadLength, BadMARC
7-
8+
from openlibrary.core import ia
89

910
TEST_DATA = Path(__file__).parents[2] / 'catalog' / 'marc' / 'tests' / 'test_data'
1011

openlibrary/tests/catalog/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from datetime import datetime, timedelta
2+
13
import pytest
24

3-
from datetime import datetime, timedelta
45
from openlibrary.catalog.utils import (
56
author_dates_match,
67
flip_name,

openlibrary/tests/core/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
23
import pytest
34

45

0 commit comments

Comments
 (0)