summaryrefslogtreecommitdiff
path: root/saharaclient/tests/unit/osc
diff options
context:
space:
mode:
Diffstat (limited to 'saharaclient/tests/unit/osc')
-rw-r--r--saharaclient/tests/unit/osc/v1/test_data_sources.py15
1 files changed, 14 insertions, 1 deletions
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})