Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding OCR sdk proxy implementation #500

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions otcextensions/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
'endpoint_service_type': 'object',
'set_endpoint_override': True
},
'ocr': {
'service_type': 'ocr',
},
'plas': {
'service_type': 'plas'
},
Expand Down
Empty file.
22 changes: 22 additions & 0 deletions otcextensions/sdk/ocr/ocr_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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.
from openstack import service_description

from otcextensions.sdk.ocr.v2 import _proxy


class OcrService(service_description.ServiceDescription):
"""The Optical Character Recognition (OCR) service."""

supported_versions = {
'2': _proxy.Proxy
}
Empty file.
17 changes: 17 additions & 0 deletions otcextensions/sdk/ocr/v2/_proxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.
from openstack import proxy


class Proxy(proxy.Proxy):

skip_discovery = True
Empty file.
Empty file.
23 changes: 23 additions & 0 deletions otcextensions/tests/functional/sdk/ocr/v2/test_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.
from openstack import _log
from otcextensions.tests.functional import base

_logger = _log.setup_logging('openstack')


class TestService(base.BaseFunctionalTest):

def test_initialize(self):
client = self.conn.ocr

self.assertIsNotNone(client)
Empty file.
Empty file.
22 changes: 22 additions & 0 deletions otcextensions/tests/unit/sdk/ocr/v2/test_proxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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.

from otcextensions.sdk.ocr.v2 import _proxy

from openstack.tests.unit import test_proxy_base


class TestOcrProxy(test_proxy_base.TestProxyBase):

def setUp(self):
super(TestOcrProxy, self).setUp()
self.proxy = _proxy.Proxy(self.session)
3 changes: 3 additions & 0 deletions releasenotes/notes/ocr_sdk_proxy-c4cd12d963a7aa13.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
features:
- Added OCR sdk proxy implementation.