From d7d8722ce27e308defb6764d8d76f85ce7d63927 Mon Sep 17 00:00:00 2001 From: "Lovett, Trevor" Date: Tue, 3 Mar 2020 14:04:39 -0600 Subject: [VVP] Removing outdated test-engine code Issue-ID: VVP-381 Signed-off-by: Lovett, Trevor Change-Id: I8622794a24deb83e14334e3454194914b835d37d --- iceci/decorator/__init__.py | 38 ----------------- iceci/decorator/exception_decor.py | 69 ------------------------------- iceci/decorator/logFuncEntry.py | 83 -------------------------------------- iceci/decorator/repeat.py | 50 ----------------------- 4 files changed, 240 deletions(-) delete mode 100644 iceci/decorator/__init__.py delete mode 100644 iceci/decorator/exception_decor.py delete mode 100644 iceci/decorator/logFuncEntry.py delete mode 100644 iceci/decorator/repeat.py (limited to 'iceci/decorator') diff --git a/iceci/decorator/__init__.py b/iceci/decorator/__init__.py deleted file mode 100644 index 32b601a..0000000 --- a/iceci/decorator/__init__.py +++ /dev/null @@ -1,38 +0,0 @@ - -# ============LICENSE_START========================================== -# org.onap.vvp/test-engine -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# -# Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); -# you may not use this software 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. -# -# -# -# Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); -# you may not use this documentation except in compliance with the License. -# You may obtain a copy of the License at -# -# https://creativecommons.org/licenses/by/4.0/ -# -# Unless required by applicable law or agreed to in writing, documentation -# 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. -# -# ============LICENSE_END============================================ -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. diff --git a/iceci/decorator/exception_decor.py b/iceci/decorator/exception_decor.py deleted file mode 100644 index 2bbced7..0000000 --- a/iceci/decorator/exception_decor.py +++ /dev/null @@ -1,69 +0,0 @@ - -# ============LICENSE_START========================================== -# org.onap.vvp/test-engine -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# -# Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); -# you may not use this software 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. -# -# -# -# Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); -# you may not use this documentation except in compliance with the License. -# You may obtain a copy of the License at -# -# https://creativecommons.org/licenses/by/4.0/ -# -# Unless required by applicable law or agreed to in writing, documentation -# 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. -# -# ============LICENSE_END============================================ -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -import traceback - -from services.logging_service import LoggingServiceFactory -from services.session import session - - -logger = LoggingServiceFactory.get_logger() - - -def exception(): - """ - A decorator that wraps the passed in function and logs - exceptions should one occur - - @param logger: The logging object - """ - - def decorator(func): - - def wrapper(*args, **kwargs): - try: - return func(*args, **kwargs) - except BaseException: - err = "There was an exception in %s" % func.__name__ - logger.error(err) - session.errorCounter += 1 - session.errorList = traceback.format_exc() - raise - - return wrapper - return decorator diff --git a/iceci/decorator/logFuncEntry.py b/iceci/decorator/logFuncEntry.py deleted file mode 100644 index 3caac92..0000000 --- a/iceci/decorator/logFuncEntry.py +++ /dev/null @@ -1,83 +0,0 @@ - -# ============LICENSE_START========================================== -# org.onap.vvp/test-engine -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# -# Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); -# you may not use this software 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. -# -# -# -# Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); -# you may not use this documentation except in compliance with the License. -# You may obtain a copy of the License at -# -# https://creativecommons.org/licenses/by/4.0/ -# -# Unless required by applicable law or agreed to in writing, documentation -# 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. -# -# ============LICENSE_END============================================ -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -from services.logging_service import LoggingServiceFactory -logger = LoggingServiceFactory.get_logger() - - -def _aop(decorator): - '''This decorator can be used to turn simple functions - into well-behaved decorators, so long as the decorators - are fairly simple. If a decorator expects a function and - returns a function (no descriptors), and if it doesn't - modify function attributes or docstring, then it is - eligible to use this. Simply apply @_aop to - your decorator and it will automatically preserve the - docstring and function attributes of functions to which - it is applied.''' - def new_decorator(f): - g = decorator(f) - g.__name__ = f.__name__ - g.__doc__ = f.__doc__ - g.__dict__.update(f.__dict__) - return g - - # Now a few lines needed to make _aop itself - # be a well-behaved decorator. - new_decorator.__name__ = decorator.__name__ - new_decorator.__doc__ = decorator.__doc__ - new_decorator.__dict__.update(decorator.__dict__) - return new_decorator - -# -# Sample Use: -# - - -@_aop -def logFuncEntry(func): - def foo(*args, **kwargs): - logger.debug( - 'calling {}'.format( - func.__name__) + - " | " + - str(args) + - " | " + - str(kwargs)) - return func(*args, **kwargs) - return foo diff --git a/iceci/decorator/repeat.py b/iceci/decorator/repeat.py deleted file mode 100644 index cf57a14..0000000 --- a/iceci/decorator/repeat.py +++ /dev/null @@ -1,50 +0,0 @@ - -# ============LICENSE_START========================================== -# org.onap.vvp/test-engine -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# -# Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); -# you may not use this software 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. -# -# -# -# Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); -# you may not use this documentation except in compliance with the License. -# You may obtain a copy of the License at -# -# https://creativecommons.org/licenses/by/4.0/ -# -# Unless required by applicable law or agreed to in writing, documentation -# 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. -# -# ============LICENSE_END============================================ -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -import time - - -def repeat(times): - def repeatHelper(f): - def callHelper(*args): - for i in range(0, times): - f(*args) - time.sleep(3) - return callHelper - time.sleep(3) - return repeatHelper -- cgit