Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Oct 25, 2019
1 parent cefe30b commit 998745d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
8 changes: 4 additions & 4 deletions ckan/tests/legacy/functional/test_package.py
Expand Up @@ -217,15 +217,13 @@ class TestReadOnly(TestPackageForm, HtmlCheckMethods):
def setup_class(cls):
CreateTestData.create()

@classmethod
def teardown_class(cls):
model.repo.rebuild_db()

@pytest.mark.usefixtures('clean_db')
def test_read_nonexistentpackage(self):
name = 'anonexistentpackage'
offset = url_for('dataset.read', id=name)
res = self.app.get(offset, status=404)

@pytest.mark.usefixtures('clean_db')
def test_read_internal_links(self):
pkg_name = u'link-test',
CreateTestData.create_arbitrary([
Expand All @@ -249,6 +247,7 @@ def check_link(res, controller, id):
assert 'decoy</a>' not in res, res
assert 'decoy"' not in res, res

@pytest.mark.usefixtures('clean_db')
def test_read_plugin_hook(self):
plugins.load('test_package_controller_plugin')
plugin = plugins.get_plugin('test_package_controller_plugin')
Expand All @@ -260,6 +259,7 @@ def test_read_plugin_hook(self):
assert plugin.calls['after_show'] == 1, plugin.calls
plugins.unload('test_package_controller_plugin')

@pytest.mark.usefixtures('clean_db')
def test_resource_list(self):
# TODO restore this test. It doesn't make much sense with the
# present resource list design.
Expand Down
32 changes: 16 additions & 16 deletions ckan/tests/lib/test_base.py
Expand Up @@ -113,11 +113,11 @@ def test_cors_config_origin_allow_all_true_with_origin(app):
assert response_headers["Access-Control-Allow-Origin"] == "*"
assert (
response_headers["Access-Control-Allow-Methods"]
== "POST, PUT, GET, DELETE, OPTIONS",
== "POST, PUT, GET, DELETE, OPTIONS"
)
assert (
response_headers["Access-Control-Allow-Headers"]
== "X-CKAN-API-KEY, Authorization, Content-Type",
== "X-CKAN-API-KEY, Authorization, Content-Type"
)


Expand Down Expand Up @@ -156,15 +156,15 @@ def test_cors_config_origin_allow_all_false_with_whitelisted_origin(app):
assert "Access-Control-Allow-Origin" in response_headers
assert (
response_headers["Access-Control-Allow-Origin"]
== "http://thirdpartyrequests.org",
== "http://thirdpartyrequests.org"
)
assert (
response_headers["Access-Control-Allow-Methods"]
== "POST, PUT, GET, DELETE, OPTIONS",
== "POST, PUT, GET, DELETE, OPTIONS"
)
assert (
response_headers["Access-Control-Allow-Headers"]
== "X-CKAN-API-KEY, Authorization, Content-Type",
== "X-CKAN-API-KEY, Authorization, Content-Type"
)


Expand All @@ -190,15 +190,15 @@ def test_cors_config_origin_allow_all_false_with_multiple_whitelisted_origins(
assert "Access-Control-Allow-Origin" in response_headers
assert (
response_headers["Access-Control-Allow-Origin"]
== "http://thirdpartyrequests.org",
== "http://thirdpartyrequests.org"
)
assert (
response_headers["Access-Control-Allow-Methods"]
== "POST, PUT, GET, DELETE, OPTIONS",
== "POST, PUT, GET, DELETE, OPTIONS"
)
assert (
response_headers["Access-Control-Allow-Headers"]
== "X-CKAN-API-KEY, Authorization, Content-Type",
== "X-CKAN-API-KEY, Authorization, Content-Type"
)


Expand Down Expand Up @@ -298,11 +298,11 @@ def test_cors_config_origin_allow_all_true_with_origin_2(app):
assert response_headers["Access-Control-Allow-Origin"] == "*"
assert (
response_headers["Access-Control-Allow-Methods"]
== "POST, PUT, GET, DELETE, OPTIONS",
== "POST, PUT, GET, DELETE, OPTIONS"
)
assert (
response_headers["Access-Control-Allow-Headers"]
== "X-CKAN-API-KEY, Authorization, Content-Type",
== "X-CKAN-API-KEY, Authorization, Content-Type"
)


Expand Down Expand Up @@ -347,15 +347,15 @@ def test_cors_config_origin_allow_all_false_with_whitelisted_origin_2(app):
assert "Access-Control-Allow-Origin" in response_headers
assert (
response_headers["Access-Control-Allow-Origin"]
== "http://thirdpartyrequests.org",
== "http://thirdpartyrequests.org"
)
assert (
response_headers["Access-Control-Allow-Methods"]
== "POST, PUT, GET, DELETE, OPTIONS",
== "POST, PUT, GET, DELETE, OPTIONS"
)
assert (
response_headers["Access-Control-Allow-Headers"]
== "X-CKAN-API-KEY, Authorization, Content-Type",
== "X-CKAN-API-KEY, Authorization, Content-Type"
)


Expand Down Expand Up @@ -383,15 +383,15 @@ def test_cors_config_origin_allow_all_false_with_multiple_whitelisted_origins_2(
assert "Access-Control-Allow-Origin" in response_headers
assert (
response_headers["Access-Control-Allow-Origin"]
== "http://thirdpartyrequests.org",
== "http://thirdpartyrequests.org"
)
assert (
response_headers["Access-Control-Allow-Methods"]
== "POST, PUT, GET, DELETE, OPTIONS",
== "POST, PUT, GET, DELETE, OPTIONS"
)
assert (
response_headers["Access-Control-Allow-Headers"]
== "X-CKAN-API-KEY, Authorization, Content-Type",
== "X-CKAN-API-KEY, Authorization, Content-Type"
)


Expand Down

0 comments on commit 998745d

Please sign in to comment.