diff options
author | vrvarma <vikas.varma@att.com> | 2020-09-17 02:24:00 -0400 |
---|---|---|
committer | vrvarma <vikas.varma@att.com> | 2020-09-17 04:52:05 -0400 |
commit | a55cbabaef4975d5007363e59d4560cb30a855e3 (patch) | |
tree | c30f83a71fee88744acbfd8bf8447c7ccbf24395 /test/logging | |
parent | 2024d8efab152980640b624402b6076da338ef7f (diff) |
Fix osdf code after upgrading to py38
Fix osdf logging to work with 3.8
Fix osdf code that broke after migration
Fix test cases after migration
Fixing pep8 violations
Change-Id: I11ca33959882c8b9010f00ff744d59c7eeb3c2f2
Signed-off-by: vrvarma <vikas.varma@att.com>
Issue-ID: OPTFRA-796
Diffstat (limited to 'test/logging')
-rwxr-xr-x | test/logging/test_osdf_logging.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/logging/test_osdf_logging.py b/test/logging/test_osdf_logging.py index 50689dd..c8fa3ae 100755 --- a/test/logging/test_osdf_logging.py +++ b/test/logging/test_osdf_logging.py @@ -16,13 +16,11 @@ # ------------------------------------------------------------------------- # import unittest -import json -import yaml +from unittest import mock from osdf.logging import osdf_logging as L1 -from osdf.logging.osdf_logging import OOF_OSDFLogMessageHelper as MH -from osdf.logging.osdf_logging import OOF_OSDFLogMessageFormatter as formatter -from unittest import mock +from osdf.logging.osdf_logging import OOFOSDFLogMessageFormatter as formatter +from osdf.logging.osdf_logging import OOFOSDFLogMessageHelper as MH class TestOSDFLogging(unittest.TestCase): @@ -46,7 +44,7 @@ class TestOSDFLogging(unittest.TestCase): self.F = formatter def test_format_exception(self): - res = L1.format_exception(Exception("Some error")) + L1.format_exception(Exception("Some error")) def test_accepted_valid_request(self): res = formatter.accepted_valid_request(self.req_id, self.request) @@ -91,7 +89,7 @@ class TestOSDFLogging(unittest.TestCase): def test_error_calling_back(self): res = formatter.error_calling_back(self.service_name, self.callback_url, self.err) assert res.startswith("Error while posting result to callback URL") - + def test_calling_back(self): res = formatter.calling_back(self.req_id, self.callback_url) assert res.startswith("Posting result to callback URL") @@ -167,4 +165,3 @@ class TestOSDFLogging(unittest.TestCase): if __name__ == "__main__": unittest.main() - |