diff --git a/manilaclient/tests/unit/v1/test_limits.py b/manilaclient/tests/unit/v1/test_limits.py new file mode 100644 index 000000000..71dbd7469 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_limits.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class LimitsV1Test(utils.TestCase): + + def test_import_v1_limits_module(self): + try: + from manilaclient.v1 import limits + except Exception as e: + msg = ("module 'manilaclient.v1.limits' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('Limits', 'RateLimit', 'AbsoluteLimit', 'LimitsManager'): + msg = "Module 'limits' has no '%s' attr." % cls + self.assertTrue(hasattr(limits, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_quota_classes.py b/manilaclient/tests/unit/v1/test_quota_classes.py new file mode 100644 index 000000000..22df24409 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_quota_classes.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class QuotaClassesV1Test(utils.TestCase): + + def test_import_v1_quota_classes_module(self): + try: + from manilaclient.v1 import quota_classes + except Exception as e: + msg = ("module 'manilaclient.v1.quota_classes' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('QuotaClassSet', 'QuotaClassSetManager'): + msg = "Module 'quota_classes' has no '%s' attr." % cls + self.assertTrue(hasattr(quota_classes, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_quotas.py b/manilaclient/tests/unit/v1/test_quotas.py new file mode 100644 index 000000000..69610b8c7 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_quotas.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class QuotasV1Test(utils.TestCase): + + def test_import_v1_quotas_module(self): + try: + from manilaclient.v1 import quotas + except Exception as e: + msg = ("module 'manilaclient.v1.quotas' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('QuotaSet', 'QuotaSetManager'): + msg = "Module 'quotas' has no '%s' attr." % cls + self.assertTrue(hasattr(quotas, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_scheduler_stats.py b/manilaclient/tests/unit/v1/test_scheduler_stats.py new file mode 100644 index 000000000..9c3e7b296 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_scheduler_stats.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class SchedulerStatsV1Test(utils.TestCase): + + def test_import_v1_scheduler_stats_module(self): + try: + from manilaclient.v1 import scheduler_stats + except Exception as e: + msg = ("module 'manilaclient.v1.scheduler_stats' cannot be " + "imported with error: %s") % six.text_type(e) + assert False, msg + for cls in ('Pool', 'PoolManager'): + msg = "Module 'scheduler_stats' has no '%s' attr." % cls + self.assertTrue(hasattr(scheduler_stats, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_security_services.py b/manilaclient/tests/unit/v1/test_security_services.py new file mode 100644 index 000000000..ace06d71e --- /dev/null +++ b/manilaclient/tests/unit/v1/test_security_services.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class SecurityServicesV1Test(utils.TestCase): + + def test_import_v1_security_services_module(self): + try: + from manilaclient.v1 import security_services + except Exception as e: + msg = ("module 'manilaclient.v1.security_services' cannot be " + "imported with error: %s") % six.text_type(e) + assert False, msg + for cls in ('SecurityService', 'SecurityServiceManager'): + msg = "Module 'security_services' has no '%s' attr." % cls + self.assertTrue(hasattr(security_services, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_services.py b/manilaclient/tests/unit/v1/test_services.py new file mode 100644 index 000000000..e4c74d132 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_services.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class ServicesV1Test(utils.TestCase): + + def test_import_v1_services_module(self): + try: + from manilaclient.v1 import services + except Exception as e: + msg = ("module 'manilaclient.v1.services' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('Service', 'ServiceManager'): + msg = "Module 'services' has no '%s' attr." % cls + self.assertTrue(hasattr(services, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_share_networks.py b/manilaclient/tests/unit/v1/test_share_networks.py new file mode 100644 index 000000000..1664ac73e --- /dev/null +++ b/manilaclient/tests/unit/v1/test_share_networks.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class ShareNetworksV1Test(utils.TestCase): + + def test_import_v1_share_networks_module(self): + try: + from manilaclient.v1 import share_networks + except Exception as e: + msg = ("module 'manilaclient.v1.share_networks' cannot be " + "imported with error: %s") % six.text_type(e) + assert False, msg + for cls in ('ShareNetwork', 'ShareNetworkManager'): + msg = "Module 'share_networks' has no '%s' attr." % cls + self.assertTrue(hasattr(share_networks, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_share_servers.py b/manilaclient/tests/unit/v1/test_share_servers.py new file mode 100644 index 000000000..fc08d1159 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_share_servers.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class ShareServersV1Test(utils.TestCase): + + def test_import_v1_share_servers_module(self): + try: + from manilaclient.v1 import share_servers + except Exception as e: + msg = ("module 'manilaclient.v1.share_servers' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('ShareServer', 'ShareServerManager'): + msg = "Module 'share_servers' has no '%s' attr." % cls + self.assertTrue(hasattr(share_servers, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_share_snapshots.py b/manilaclient/tests/unit/v1/test_share_snapshots.py new file mode 100644 index 000000000..6ea6c196a --- /dev/null +++ b/manilaclient/tests/unit/v1/test_share_snapshots.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class ShareSnapshotsV1Test(utils.TestCase): + + def test_import_v1_share_snapshots_module(self): + try: + from manilaclient.v1 import share_snapshots + except Exception as e: + msg = ("module 'manilaclient.v1.share_snapshots' cannot be " + "imported with error: %s") % six.text_type(e) + assert False, msg + for cls in ('ShareSnapshot', 'ShareSnapshotManager'): + msg = "Module 'share_snapshots' has no '%s' attr." % cls + self.assertTrue(hasattr(share_snapshots, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_share_type_access.py b/manilaclient/tests/unit/v1/test_share_type_access.py new file mode 100644 index 000000000..dcb09634a --- /dev/null +++ b/manilaclient/tests/unit/v1/test_share_type_access.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class ShareTypeAccessV1Test(utils.TestCase): + + def test_import_v1_share_type_access_module(self): + try: + from manilaclient.v1 import share_type_access + except Exception as e: + msg = ("module 'manilaclient.v1.share_type_access' cannot be " + "imported with error: %s") % six.text_type(e) + assert False, msg + for cls in ('ShareTypeAccess', 'ShareTypeAccessManager'): + msg = "Module 'share_type_access' has no '%s' attr." % cls + self.assertTrue(hasattr(share_type_access, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_share_types.py b/manilaclient/tests/unit/v1/test_share_types.py new file mode 100644 index 000000000..08f389321 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_share_types.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class ShareTypesV1Test(utils.TestCase): + + def test_import_v1_share_types_module(self): + try: + from manilaclient.v1 import share_types + except Exception as e: + msg = ("module 'manilaclient.v1.share_types' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('ShareType', 'ShareTypeManager'): + msg = "Module 'share_types' has no '%s' attr." % cls + self.assertTrue(hasattr(share_types, cls), msg) diff --git a/manilaclient/tests/unit/v1/test_shares.py b/manilaclient/tests/unit/v1/test_shares.py new file mode 100644 index 000000000..19b057e96 --- /dev/null +++ b/manilaclient/tests/unit/v1/test_shares.py @@ -0,0 +1,32 @@ +# Copyright 2016 Mirantis Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + +from manilaclient.tests.unit import utils + + +class SharesV1Test(utils.TestCase): + + def test_import_v1_shares_module(self): + try: + from manilaclient.v1 import shares + except Exception as e: + msg = ("module 'manilaclient.v1.shares' cannot be imported " + "with error: %s") % six.text_type(e) + assert False, msg + for cls in ('Share', 'ShareManager'): + msg = "Module 'shares' has no '%s' attr." % cls + self.assertTrue(hasattr(shares, cls), msg) diff --git a/manilaclient/v1/limits.py b/manilaclient/v1/limits.py index 2630843d2..9b853baf9 100644 --- a/manilaclient/v1/limits.py +++ b/manilaclient/v1/limits.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.limits"] = MovedModule(limits) +sys.modules["manilaclient.v1.limits"] = MovedModule(limits) diff --git a/manilaclient/v1/quota_classes.py b/manilaclient/v1/quota_classes.py index 73977cefc..cb97ca114 100644 --- a/manilaclient/v1/quota_classes.py +++ b/manilaclient/v1/quota_classes.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.quota_classes"] = MovedModule(quota_classes) +sys.modules["manilaclient.v1.quota_classes"] = MovedModule(quota_classes) diff --git a/manilaclient/v1/quotas.py b/manilaclient/v1/quotas.py index febc30087..8aab75142 100644 --- a/manilaclient/v1/quotas.py +++ b/manilaclient/v1/quotas.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.quotas"] = MovedModule(quotas) +sys.modules["manilaclient.v1.quotas"] = MovedModule(quotas) diff --git a/manilaclient/v1/scheduler_stats.py b/manilaclient/v1/scheduler_stats.py index e19120b1f..f62dbab99 100644 --- a/manilaclient/v1/scheduler_stats.py +++ b/manilaclient/v1/scheduler_stats.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.scheduler_stats"] = MovedModule(scheduler_stats) +sys.modules["manilaclient.v1.scheduler_stats"] = MovedModule(scheduler_stats) diff --git a/manilaclient/v1/security_services.py b/manilaclient/v1/security_services.py index 1ce6120ce..c231d8e96 100644 --- a/manilaclient/v1/security_services.py +++ b/manilaclient/v1/security_services.py @@ -33,4 +33,4 @@ class MovedModule(object): return getattr(self.new_module, attr) sys.modules[ - "manilaclient.v2.security_services"] = MovedModule(security_services) + "manilaclient.v1.security_services"] = MovedModule(security_services) diff --git a/manilaclient/v1/services.py b/manilaclient/v1/services.py index bc817a1f1..ec63fbd50 100644 --- a/manilaclient/v1/services.py +++ b/manilaclient/v1/services.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.services"] = MovedModule(services) +sys.modules["manilaclient.v1.services"] = MovedModule(services) diff --git a/manilaclient/v1/share_networks.py b/manilaclient/v1/share_networks.py index be68218ae..883162b4f 100644 --- a/manilaclient/v1/share_networks.py +++ b/manilaclient/v1/share_networks.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.share_networks"] = MovedModule(share_networks) +sys.modules["manilaclient.v1.share_networks"] = MovedModule(share_networks) diff --git a/manilaclient/v1/share_servers.py b/manilaclient/v1/share_servers.py index 008f13480..b7075b51c 100644 --- a/manilaclient/v1/share_servers.py +++ b/manilaclient/v1/share_servers.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.share_servers"] = MovedModule(share_servers) +sys.modules["manilaclient.v1.share_servers"] = MovedModule(share_servers) diff --git a/manilaclient/v1/share_snapshots.py b/manilaclient/v1/share_snapshots.py index cb57d8438..b522bbc2f 100644 --- a/manilaclient/v1/share_snapshots.py +++ b/manilaclient/v1/share_snapshots.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.share_snapshots"] = MovedModule(share_snapshots) +sys.modules["manilaclient.v1.share_snapshots"] = MovedModule(share_snapshots) diff --git a/manilaclient/v1/share_type_access.py b/manilaclient/v1/share_type_access.py index 0992e450c..f77502d77 100644 --- a/manilaclient/v1/share_type_access.py +++ b/manilaclient/v1/share_type_access.py @@ -33,4 +33,4 @@ class MovedModule(object): return getattr(self.new_module, attr) sys.modules[ - "manilaclient.v2.share_type_access"] = MovedModule(share_type_access) + "manilaclient.v1.share_type_access"] = MovedModule(share_type_access) diff --git a/manilaclient/v1/share_types.py b/manilaclient/v1/share_types.py index 7ff14a8b7..58d11ff7f 100644 --- a/manilaclient/v1/share_types.py +++ b/manilaclient/v1/share_types.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.share_types"] = MovedModule(share_types) +sys.modules["manilaclient.v1.share_types"] = MovedModule(share_types) diff --git a/manilaclient/v1/shares.py b/manilaclient/v1/shares.py index 727c6326c..dce2a190b 100644 --- a/manilaclient/v1/shares.py +++ b/manilaclient/v1/shares.py @@ -32,4 +32,4 @@ class MovedModule(object): def __getattr__(self, attr): return getattr(self.new_module, attr) -sys.modules["manilaclient.v2.shares"] = MovedModule(shares) +sys.modules["manilaclient.v1.shares"] = MovedModule(shares)