Skip to content

Commit

Permalink
Fixed tests with object_name parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardparis committed Nov 14, 2017
1 parent 23f855a commit 077738d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/filters/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_filter_deploy_to_project_ok(self, mock_put_object):
# Call filter_deploy
data = {"filter_id": "fake", "target_id": "0123456789abcdef",
"execution_server": "proxy", "execution_server_reverse": "proxy",
"object_type": "", "object_size": "", "object_tag": "", "params": ""}
"object_type": "", "object_size": "", "object_tag": "", "object_name": "", "params": ""}

request = self.factory.put('/filters/0123456789abcdef/deploy/fake', data, format='json')
request.META['HTTP_X_AUTH_TOKEN'] = 'fake_token'
Expand All @@ -231,7 +231,7 @@ def test_filter_deploy_to_project_and_container_ok(self, mock_put_object):
# Call filter_deploy
data = {"filter_id": "fake", "target_id": "0123456789abcdef",
"execution_server": "proxy", "execution_server_reverse": "proxy",
"object_type": "", "object_size": "", "object_tag": "", "params": ""}
"object_type": "", "object_size": "", "object_tag": "", "object_name": "", "params": ""}

request = self.factory.put('/filters/0123456789abcdef/container1/deploy/fake', data, format='json')
request.META['HTTP_X_AUTH_TOKEN'] = 'fake_token'
Expand Down
4 changes: 3 additions & 1 deletion api/policies/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def test_registry_static_policy_create_set_filter_ok(self, mock_set_filter, mock
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertTrue(mock_set_filter.called)
expected_policy_data = {'object_size': '', 'execution_order': 2, 'object_type': 'DOCS', 'params': mock.ANY,
'execution_server': 'PROXY', 'callable': False, 'object_tag': '', 'policy_id': 2}
'execution_server': 'PROXY', 'callable': False, 'object_tag': '', 'policy_id': 2,
'object_name': ''}
mock_set_filter.assert_called_with(mock.ANY, '0123456789abcdef', mock.ANY, expected_policy_data, 'fake_token')

@mock.patch('policies.views.deploy_dynamic_policy')
Expand Down Expand Up @@ -667,6 +668,7 @@ def deploy_storlet(self, mock_put_object, mock_get_project_list):
"object_type": None,
"object_size": None,
"object_tag": None,
"object_name": None,
"execution_order": "1",
"params": ""
}
Expand Down

0 comments on commit 077738d

Please sign in to comment.