Skip to content

Commit

Permalink
Merge pull request #6 from FIWARE-TMForum/task/update-unit-tests
Browse files Browse the repository at this point in the history
Update Unit tests
  • Loading branch information
fdelavega authored Jul 16, 2018
2 parents 367f207 + afdb879 commit 2cfae72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ckanext/baepublisher/tests/test_store_connector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2015 - 2017 Conwet Lab., Universidad Politécnica de Madrid
# Copyright (C) 2015 - 2018 Conwet Lab., Universidad Politécnica de Madrid

# This file is part of CKAN Store Publisher Extension.

Expand Down Expand Up @@ -234,9 +234,9 @@ def refresh_function_side_effect():
# If the first request returns a 401, the request is retried with a new access_token...
if response_status != 401:
self.assertEquals(first_response, result)
req_method.assert_called_once_with(url, headers=expected_headers, json=data)
req_method.assert_called_once_with(url, headers=expected_headers, json=data, verify=True)
store_connector.OAuth2Session.assert_called_once_with(token=usertoken)
req_method.assert_called_once_with(url, headers=expected_headers, json=data)
req_method.assert_called_once_with(url, headers=expected_headers, json=data, verify=True)
else:
# Check that the token has been refreshed
store_connector.plugins.toolkit.c.usertoken_refresh.assert_called_once_with()
Expand Down
4 changes: 2 additions & 2 deletions ckanext/baepublisher/tests/test_ui_controller.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright (c) 2014 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid
# Copyright (c) 2014 - 2018 CoNWeT Lab., Universidad Politécnica de Madrid

# This file is part of CKAN Store Publisher Extension.

Expand Down Expand Up @@ -118,7 +118,7 @@ def test_get_content(self, content, resp, filters):
requests.get.assert_called_once_with(
'{0}/DSProductCatalog/api/catalogManagement/v2/{1}'.format(
self._store_connector_instance.store_url, content),
params=filters)
params=filters, verify=True)

if content == 'category' or content == 'catalog':
self.assertEquals(r, {'id': '1'})
Expand Down
4 changes: 3 additions & 1 deletion test.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[app:main]
use = config:./ckan/test-core.ini
use = config:./ckan/test-core.ini

ckan.baepublisher.store_url = http://teststore.com

0 comments on commit 2cfae72

Please sign in to comment.