Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Oct 31, 2019
2 parents 8e56b50 + 986e1ca commit 2f56f39
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 344 deletions.
2 changes: 1 addition & 1 deletion ckan/cli/datastore.py
Expand Up @@ -11,7 +11,7 @@

import ckanext.datastore as datastore_module
from ckanext.datastore.backend.postgres import identifier
from ckanext.datastore.view import DUMP_FORMATS, dump_to
from ckanext.datastore.blueprint import DUMP_FORMATS, dump_to

log = logging.getLogger(__name__)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ckanext/datastore/commands.py
Expand Up @@ -9,7 +9,7 @@
click_config_option,
)
from ckanext.datastore.backend.postgres import identifier
from ckanext.datastore.view import DUMP_FORMATS, dump_to
from ckanext.datastore.blueprint import DUMP_FORMATS, dump_to

import click

Expand Down
209 changes: 0 additions & 209 deletions ckanext/datastore/controller.py

This file was deleted.

2 changes: 1 addition & 1 deletion ckanext/datastore/plugin.py
Expand Up @@ -19,7 +19,7 @@
DatastoreBackend
)
from ckanext.datastore.backend.postgres import DatastorePostgresqlBackend
import ckanext.datastore.view as view
import ckanext.datastore.blueprint as view

log = logging.getLogger(__name__)
_get_or_bust = logic.get_or_bust
Expand Down
16 changes: 8 additions & 8 deletions ckanext/datastore/tests/test_dump.py
Expand Up @@ -337,7 +337,7 @@ def test_dump_with_low_rows_max(self, app):

@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 5)
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 5)
def test_dump_pagination(self, app):
resource = factories.Resource()
data = {
Expand All @@ -353,8 +353,7 @@ def test_dump_pagination(self, app):
@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@pytest.mark.ckan_config("ckan.datastore.search.rows_max", "7")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 5)
def test_dump_pagination_csv_with_limit(self, app):
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 5)
resource = factories.Resource()
data = {
"resource_id": resource["id"],
Expand All @@ -371,7 +370,7 @@ def test_dump_pagination_csv_with_limit(self, app):
@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@pytest.mark.ckan_config("ckan.datastore.search.rows_max", "7")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 6)
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 6)
def test_dump_pagination_csv_with_limit_same_as_paginate(self, app):
resource = factories.Resource()
data = {
Expand All @@ -386,10 +385,11 @@ def test_dump_pagination_csv_with_limit_same_as_paginate(self, app):
)
assert get_csv_record_values(response.body) == range(6)


@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@pytest.mark.ckan_config("ckan.datastore.search.rows_max", "6")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 5)
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 5)
def test_dump_pagination_with_rows_max(self, app):
resource = factories.Resource()
data = {
Expand All @@ -407,7 +407,7 @@ def test_dump_pagination_with_rows_max(self, app):
@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@pytest.mark.ckan_config("ckan.datastore.search.rows_max", "6")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 6)
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 6)
def test_dump_pagination_with_rows_max_same_as_paginate(self, app):
resource = factories.Resource()
data = {
Expand All @@ -425,7 +425,7 @@ def test_dump_pagination_with_rows_max_same_as_paginate(self, app):
@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@pytest.mark.ckan_config("ckan.datastore.search.rows_max", "7")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 5)
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 5)
def test_dump_pagination_json_with_limit(self, app):
resource = factories.Resource()
data = {
Expand All @@ -445,7 +445,7 @@ def test_dump_pagination_json_with_limit(self, app):
@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
@pytest.mark.ckan_config("ckan.datastore.search.rows_max", "6")
@mock.patch("ckanext.datastore.controller.PAGINATE_BY", 5)
@mock.patch("ckanext.datastore.blueprint.PAGINATE_BY", 5)
def test_dump_pagination_json_with_rows_max(self, app):
resource = factories.Resource()
data = {
Expand Down

0 comments on commit 2f56f39

Please sign in to comment.