This repository has been archived by the owner on Mar 28, 2019. It is now read-only.
Refactor the imports - Refs #34 #277
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
""" | ||
import warnings | ||
import pkg_resources | ||
|
||
import structlog | ||
|
||
from cornice import Service | ||
from pyramid.settings import asbool, aslist | ||
|
||
|
@@ -13,7 +13,8 @@ | |
from cliquet import utils | ||
from cliquet.initialization import ( # NOQA | ||
initialize, initialize_cliquet, install_middlewares) | ||
|
||
from cliquet import resource | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it is not what we want. We should probably define all to define the exaustive list of what we want to expose in cliquet itself. See https://github.com/django/django/blob/master/django/core/files/__init__.py#L3 |
||
from cliquet import logger | ||
|
||
# Module version, as defined in PEP-0396. | ||
__version__ = pkg_resources.get_distribution(__package__).version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import six | ||
from pyramid import httpexceptions | ||
|
||
from cliquet import logger | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
from cliquet.utils import Enum, json, reapply_cors | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import mock | ||
|
||
import cliquet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it necessary? |
||
from .test_views import BaseWebTest, FakeAuthentMixin | ||
|
||
|
||
|
@@ -84,7 +84,7 @@ def test_present_on_unauthorized(self): | |
self.assertIn('Access-Control-Allow-Origin', response.headers) | ||
|
||
def test_present_on_internal_error(self): | ||
with mock.patch('cliquet.resource.BaseResource.get_records', | ||
with mock.patch('cliquet.resource.Resource.get_records', | ||
side_effect=ValueError): | ||
response = self.app.get('/mushrooms', | ||
headers=self.headers, status=500) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we separate imports from the sdlib from imports from other libraries having
import
first and thenfrom