コード例 #1
0
ファイル: test_extensions.py プロジェクト: openstack/fuel-web
    def test_validate_extensions(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'

        with mock.patch(
                'nailgun.api.v1.validators.extension.get_all_extensions',
                return_value=make_mock_extensions(global_exts)):

            ExtensionValidator.validate(jsonutils.dumps(global_exts))
コード例 #2
0
    def test_validate_extensions(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'

        with mock.patch(
                'nailgun.api.v1.validators.extension.get_all_extensions',
                return_value=make_mock_extensions(global_exts)):

            ExtensionValidator.validate(jsonutils.dumps(global_exts))
コード例 #3
0
    def test_invalid_delete_extensions(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'
        data = 'volume_manager', 'bareon', 'invalid'
        cluster = mock.Mock()
        cluster.extensions = global_exts

        with self.assertRaisesRegexp(errors.CannotFindExtension,
                                     'No such extensions to disable: invalid'):
            ExtensionValidator.validate_delete(set(data), cluster)
コード例 #4
0
ファイル: test_extensions.py プロジェクト: openstack/fuel-web
    def test_invalid_delete_extensions(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'
        data = 'volume_manager', 'bareon', 'invalid'
        cluster = mock.Mock()
        cluster.extensions = global_exts

        with self.assertRaisesRegexp(errors.CannotFindExtension,
                                     'No such extensions to disable: invalid'):
                ExtensionValidator.validate_delete(set(data), cluster)
コード例 #5
0
    def test_invalid_extension(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'
        data = 'volume_manager', 'baleron'

        with mock.patch(
                'nailgun.api.v1.validators.extension.get_all_extensions',
                return_value=make_mock_extensions(global_exts)):

            with self.assertRaisesRegexp(errors.CannotFindExtension,
                                         'No such extensions: baleron'):

                ExtensionValidator.validate(jsonutils.dumps(data))
コード例 #6
0
ファイル: test_extensions.py プロジェクト: openstack/fuel-web
    def test_invalid_extension(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'
        data = 'volume_manager', 'baleron'

        with mock.patch(
                'nailgun.api.v1.validators.extension.get_all_extensions',
                return_value=make_mock_extensions(global_exts)):

            with self.assertRaisesRegexp(errors.CannotFindExtension,
                                         'No such extensions: baleron'):

                ExtensionValidator.validate(jsonutils.dumps(data))
コード例 #7
0
    def test_validate_delete_extensions(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'
        cluster = mock.Mock()
        cluster.extensions = global_exts

        ExtensionValidator.validate_delete(set(global_exts[:2]), cluster)
コード例 #8
0
ファイル: test_extensions.py プロジェクト: openstack/fuel-web
    def test_validate_delete_extensions(self):
        global_exts = 'volume_manager', 'bareon', 'ultralogger'
        cluster = mock.Mock()
        cluster.extensions = global_exts

        ExtensionValidator.validate_delete(set(global_exts[:2]), cluster)