From 778d8b30b648f638f1999a0eeea14fc6d4c67f1d Mon Sep 17 00:00:00 2001 From: Andrey Pavlov Date: Thu, 1 Oct 2015 17:49:14 +0300 Subject: Changing public/protected options handling Partially implements: blueprint cli-as-openstackclient-plugin Change-Id: I7f0dbec47f8c670c942a5244be96dde215a59f35 --- saharaclient/tests/unit/osc/v1/test_data_sources.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'saharaclient/tests/unit/osc/v1') diff --git a/saharaclient/tests/unit/osc/v1/test_data_sources.py b/saharaclient/tests/unit/osc/v1/test_data_sources.py index b031a0b..fe3f07a 100644 --- a/saharaclient/tests/unit/osc/v1/test_data_sources.py +++ b/saharaclient/tests/unit/osc/v1/test_data_sources.py @@ -260,7 +260,7 @@ class TestUpdateDataSource(TestDataSources): ('url', 'swift://container.sahara/object'), ('username', 'user'), ('password', 'pass'), ('description', 'Data Source for tests'), - ('public', True), ('protected', True)] + ('is_public', True), ('is_protected', True)] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -283,3 +283,16 @@ class TestUpdateDataSource(TestDataSources): expected_data = ('Data Source for tests', 'id', True, True, 'source', 'swift', 'swift://container.sahara/object') self.assertEqual(expected_data, data) + + def test_data_sources_update_privat_unprotected(self): + arglist = ['source', '--private', '--unprotected'] + verifylist = [('data_source', 'source'), ('is_public', False), + ('is_protected', False)] + + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.cmd.take_action(parsed_args) + + # Check that data source was created with correct arguments + self.ds_mock.update.assert_called_once_with( + 'id', {'is_public': False, 'is_protected': False}) -- cgit v1.2.1