You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by av...@apache.org on 2017/04/05 13:58:32 UTC
[16/17] incubator-ariatosca git commit: Add mock_object fixture
Add mock_object fixture
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/007e1642
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/007e1642
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/007e1642
Branch: refs/heads/cli-tests
Commit: 007e1642e3f6ce0c587163a860a435d5bf2249ad
Parents: 8b4dbe5
Author: Avia Efrat <av...@gigaspaces.com>
Authored: Wed Apr 5 16:48:50 2017 +0300
Committer: Avia Efrat <av...@gigaspaces.com>
Committed: Wed Apr 5 16:49:57 2017 +0300
----------------------------------------------------------------------
tests/cli/test_service_templates.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/007e1642/tests/cli/test_service_templates.py
----------------------------------------------------------------------
diff --git a/tests/cli/test_service_templates.py b/tests/cli/test_service_templates.py
index a6b5f12..4c2bf4d 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -7,7 +7,7 @@ import pytest
@pytest.fixture
-def mock_storage(mocker):
+def mock_object(mocker):
return mocker.MagicMock()
@@ -94,20 +94,20 @@ class TestServiceTemplatesList(TestCliBase):
assert 'test_st' in self.logger_output_string
assert 'test_st2' in self.logger_output_string
- def test_list_ascending(self, monkeypatch, mock_storage):
+ def test_list_ascending(self, monkeypatch, mock_object):
- monkeypatch.setattr(Environment, 'model_storage', mock_storage)
+ monkeypatch.setattr(Environment, 'model_storage', mock_object)
self.invoke('service_templates list --sort-by name')
- mock_storage.service_template.list.assert_called_with(sort={'name': 'asc'})
+ mock_object.service_template.list.assert_called_with(sort={'name': 'asc'})
- def test_list_descending(self, monkeypatch, mock_storage):
+ def test_list_descending(self, monkeypatch, mock_object):
- monkeypatch.setattr(Environment, 'model_storage', mock_storage)
+ monkeypatch.setattr(Environment, 'model_storage', mock_object)
self.invoke('service_templates list --sort-by name --descending')
- mock_storage.service_template.list.assert_called_with(sort={'name': 'desc'})
+ mock_object.service_template.list.assert_called_with(sort={'name': 'desc'})
- def test_list_default_sorting(self, monkeypatch, mock_storage):
+ def test_list_default_sorting(self, monkeypatch, mock_object):
- monkeypatch.setattr(Environment, 'model_storage', mock_storage)
+ monkeypatch.setattr(Environment, 'model_storage', mock_object)
self.invoke('service_templates list')
- mock_storage.service_template.list.assert_called_with(sort={'created_at': 'asc'})
+ mock_object.service_template.list.assert_called_with(sort={'created_at': 'asc'})