summaryrefslogtreecommitdiffstats
path: root/test/mainapp/test_osdfapp.py
diff options
context:
space:
mode:
authorvrvarma <vv8305@att.com>2019-12-13 10:24:55 -0500
committervrvarma <vv8305@att.com>2019-12-13 10:29:45 -0500
commit430153e1a9489a86cf0ff7942eceb0bf5f1c170c (patch)
treeb22090b80d11761a24d9cbeaa6348704cce2de83 /test/mainapp/test_osdfapp.py
parent34ba229b31758c38a299a163de0007848b5921be (diff)
osdf rearchitecture into apps and libs
Change-Id: I2db2f8e252bd5e60807b2ffabf5a5b193a789f7a Signed-off-by: vrvarma <vv8305@att.com> Issue-ID: OPTFRA-637
Diffstat (limited to 'test/mainapp/test_osdfapp.py')
-rw-r--r--test/mainapp/test_osdfapp.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/mainapp/test_osdfapp.py b/test/mainapp/test_osdfapp.py
index 7fbe707..d1f6d7e 100644
--- a/test/mainapp/test_osdfapp.py
+++ b/test/mainapp/test_osdfapp.py
@@ -15,9 +15,10 @@
#
# -------------------------------------------------------------------------
#
-import osdfapp
+
import unittest
+from osdf.apps import baseapp
from osdf.operation.exceptions import BusinessException
from requests import Request, RequestException
from schematics.exceptions import DataError
@@ -28,7 +29,7 @@ from unittest.mock import patch
class TestOSDFApp(TestCase):
def setUp(self):
- self.patcher_g = patch('osdfapp.g', return_value={'request_id':'DUMMY-REQ'})
+ self.patcher_g = patch('osdf.apps.baseapp.g', return_value={'request_id':'DUMMY-REQ'})
self.Mock_g = self.patcher_g.start()
# self.patcher2 = patch('package.module.Class2')
# self.MockClass2 = self.patcher2.start()
@@ -47,26 +48,26 @@ class TestOSDFApp(TestCase):
def test_handle_business_exception(self):
e = BusinessException("Business Exception Description")
- resp = osdfapp.handle_business_exception(e)
+ resp = baseapp.handle_business_exception(e)
assert resp.status_code == 400
def test_handle_request_exception(self):
e = self.dummy_request_exception()
- resp = osdfapp.handle_request_exception(e)
+ resp = baseapp.handle_request_exception(e)
assert resp.status_code == 400
def test_handle_data_error(self):
e = DataError({"A1": "A1 Data Error"})
- resp = osdfapp.handle_data_error(e)
+ resp = baseapp.handle_data_error(e)
assert resp.status_code == 400
def test_internal_failure(self):
e = Exception("An Internal Error")
- resp = osdfapp.internal_failure(e)
+ resp = baseapp.internal_failure(e)
assert resp.status_code == 500
def test_get_options_default(self):
- opts = osdfapp.get_options(["PROG"]) # ensure nothing breaks
+ opts = baseapp.get_options(["PROG"]) # ensure nothing breaks
if __name__ == "__main__":