diff options
Diffstat (limited to 'utils/test')
-rw-r--r-- | utils/test/testapi/3rd_party/static/.gitignore | 1 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/css/highlight.default.css (renamed from utils/test/testapi/3rd_party/static/css/highlight.default.css) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/css/hightlight.default.css (renamed from utils/test/testapi/3rd_party/static/css/hightlight.default.css) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/css/screen.css (renamed from utils/test/testapi/3rd_party/static/css/screen.css) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/endpoint.html (renamed from utils/test/testapi/3rd_party/static/endpoint.html) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/images/explorer_icons.png (renamed from utils/test/testapi/3rd_party/static/images/explorer_icons.png) | bin | 5763 -> 5763 bytes | |||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/images/logo_small.png (renamed from utils/test/testapi/3rd_party/static/images/logo_small.png) | bin | 770 -> 770 bytes | |||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/images/pet_store_api.png (renamed from utils/test/testapi/3rd_party/static/images/pet_store_api.png) | bin | 824 -> 824 bytes | |||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/images/throbber.gif (renamed from utils/test/testapi/3rd_party/static/images/throbber.gif) | bin | 9257 -> 9257 bytes | |||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/images/wordnik_api.png (renamed from utils/test/testapi/3rd_party/static/images/wordnik_api.png) | bin | 980 -> 980 bytes | |||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/index.html (renamed from utils/test/testapi/3rd_party/static/index.html) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/backbone-min.js (renamed from utils/test/testapi/3rd_party/static/lib/backbone-min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/handlebars-1.0.0.js (renamed from utils/test/testapi/3rd_party/static/lib/handlebars-1.0.0.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/highlight.7.3.pack.js (renamed from utils/test/testapi/3rd_party/static/lib/highlight.7.3.pack.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/jquery-1.8.0.min.js (renamed from utils/test/testapi/3rd_party/static/lib/jquery-1.8.0.min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/jquery.ba-bbq.min.js (renamed from utils/test/testapi/3rd_party/static/lib/jquery.ba-bbq.min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/jquery.slideto.min.js (renamed from utils/test/testapi/3rd_party/static/lib/jquery.slideto.min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/jquery.wiggle.min.js (renamed from utils/test/testapi/3rd_party/static/lib/jquery.wiggle.min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/shred.bundle.js (renamed from utils/test/testapi/3rd_party/static/lib/shred.bundle.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/shred/content.js (renamed from utils/test/testapi/3rd_party/static/lib/shred/content.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/swagger-oauth.js (renamed from utils/test/testapi/3rd_party/static/lib/swagger-oauth.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/swagger.js (renamed from utils/test/testapi/3rd_party/static/lib/swagger.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/lib/underscore-min.js (renamed from utils/test/testapi/3rd_party/static/lib/underscore-min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/o2c.html (renamed from utils/test/testapi/3rd_party/static/o2c.html) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/swagger-ui.js (renamed from utils/test/testapi/3rd_party/static/swagger-ui.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/swagger/swagger-ui.min.js (renamed from utils/test/testapi/3rd_party/static/swagger-ui.min.js) | 0 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/testapi-ui/app.js | 32 | ||||
-rw-r--r-- | utils/test/testapi/3rd_party/static/testapi-ui/index.html | 46 | ||||
-rwxr-xr-x | utils/test/testapi/install.sh | 5 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/cmd/server.py | 3 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/common/config.py | 4 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/resources/ui_handlers.py | 7 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/router/url_mappings.py | 8 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/test_base.py | 7 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py | 4 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py | 5 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tornado_swagger/views.py | 2 | ||||
-rw-r--r-- | utils/test/testapi/setup.cfg | 20 |
38 files changed, 72 insertions, 72 deletions
diff --git a/utils/test/testapi/3rd_party/static/.gitignore b/utils/test/testapi/3rd_party/static/.gitignore deleted file mode 100644 index ebf4281dc..000000000 --- a/utils/test/testapi/3rd_party/static/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!lib diff --git a/utils/test/testapi/3rd_party/static/css/highlight.default.css b/utils/test/testapi/3rd_party/static/swagger/css/highlight.default.css index e417fc179..e417fc179 100644 --- a/utils/test/testapi/3rd_party/static/css/highlight.default.css +++ b/utils/test/testapi/3rd_party/static/swagger/css/highlight.default.css diff --git a/utils/test/testapi/3rd_party/static/css/hightlight.default.css b/utils/test/testapi/3rd_party/static/swagger/css/hightlight.default.css index e417fc179..e417fc179 100644 --- a/utils/test/testapi/3rd_party/static/css/hightlight.default.css +++ b/utils/test/testapi/3rd_party/static/swagger/css/hightlight.default.css diff --git a/utils/test/testapi/3rd_party/static/css/screen.css b/utils/test/testapi/3rd_party/static/swagger/css/screen.css index 2882b8d66..2882b8d66 100644 --- a/utils/test/testapi/3rd_party/static/css/screen.css +++ b/utils/test/testapi/3rd_party/static/swagger/css/screen.css diff --git a/utils/test/testapi/3rd_party/static/endpoint.html b/utils/test/testapi/3rd_party/static/swagger/endpoint.html index 4ae3bde0c..4ae3bde0c 100644 --- a/utils/test/testapi/3rd_party/static/endpoint.html +++ b/utils/test/testapi/3rd_party/static/swagger/endpoint.html diff --git a/utils/test/testapi/3rd_party/static/images/explorer_icons.png b/utils/test/testapi/3rd_party/static/swagger/images/explorer_icons.png Binary files differindex ed9d2fffb..ed9d2fffb 100644 --- a/utils/test/testapi/3rd_party/static/images/explorer_icons.png +++ b/utils/test/testapi/3rd_party/static/swagger/images/explorer_icons.png diff --git a/utils/test/testapi/3rd_party/static/images/logo_small.png b/utils/test/testapi/3rd_party/static/swagger/images/logo_small.png Binary files differindex 5496a6557..5496a6557 100644 --- a/utils/test/testapi/3rd_party/static/images/logo_small.png +++ b/utils/test/testapi/3rd_party/static/swagger/images/logo_small.png diff --git a/utils/test/testapi/3rd_party/static/images/pet_store_api.png b/utils/test/testapi/3rd_party/static/swagger/images/pet_store_api.png Binary files differindex f9f9cd4ae..f9f9cd4ae 100644 --- a/utils/test/testapi/3rd_party/static/images/pet_store_api.png +++ b/utils/test/testapi/3rd_party/static/swagger/images/pet_store_api.png diff --git a/utils/test/testapi/3rd_party/static/images/throbber.gif b/utils/test/testapi/3rd_party/static/swagger/images/throbber.gif Binary files differindex 063938892..063938892 100644 --- a/utils/test/testapi/3rd_party/static/images/throbber.gif +++ b/utils/test/testapi/3rd_party/static/swagger/images/throbber.gif diff --git a/utils/test/testapi/3rd_party/static/images/wordnik_api.png b/utils/test/testapi/3rd_party/static/swagger/images/wordnik_api.png Binary files differindex dca4f1455..dca4f1455 100644 --- a/utils/test/testapi/3rd_party/static/images/wordnik_api.png +++ b/utils/test/testapi/3rd_party/static/swagger/images/wordnik_api.png diff --git a/utils/test/testapi/3rd_party/static/index.html b/utils/test/testapi/3rd_party/static/swagger/index.html index db209f4a8..db209f4a8 100644 --- a/utils/test/testapi/3rd_party/static/index.html +++ b/utils/test/testapi/3rd_party/static/swagger/index.html diff --git a/utils/test/testapi/3rd_party/static/lib/backbone-min.js b/utils/test/testapi/3rd_party/static/swagger/lib/backbone-min.js index c1c0d4fff..c1c0d4fff 100644 --- a/utils/test/testapi/3rd_party/static/lib/backbone-min.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/backbone-min.js diff --git a/utils/test/testapi/3rd_party/static/lib/handlebars-1.0.0.js b/utils/test/testapi/3rd_party/static/swagger/lib/handlebars-1.0.0.js index c70f09d1d..c70f09d1d 100644 --- a/utils/test/testapi/3rd_party/static/lib/handlebars-1.0.0.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/handlebars-1.0.0.js diff --git a/utils/test/testapi/3rd_party/static/lib/highlight.7.3.pack.js b/utils/test/testapi/3rd_party/static/swagger/lib/highlight.7.3.pack.js index 9a95a75ea..9a95a75ea 100644 --- a/utils/test/testapi/3rd_party/static/lib/highlight.7.3.pack.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/highlight.7.3.pack.js diff --git a/utils/test/testapi/3rd_party/static/lib/jquery-1.8.0.min.js b/utils/test/testapi/3rd_party/static/swagger/lib/jquery-1.8.0.min.js index 066d72c7e..066d72c7e 100644 --- a/utils/test/testapi/3rd_party/static/lib/jquery-1.8.0.min.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/jquery-1.8.0.min.js diff --git a/utils/test/testapi/3rd_party/static/lib/jquery.ba-bbq.min.js b/utils/test/testapi/3rd_party/static/swagger/lib/jquery.ba-bbq.min.js index bcbf24834..bcbf24834 100644 --- a/utils/test/testapi/3rd_party/static/lib/jquery.ba-bbq.min.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/jquery.ba-bbq.min.js diff --git a/utils/test/testapi/3rd_party/static/lib/jquery.slideto.min.js b/utils/test/testapi/3rd_party/static/swagger/lib/jquery.slideto.min.js index ba32cff36..ba32cff36 100644 --- a/utils/test/testapi/3rd_party/static/lib/jquery.slideto.min.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/jquery.slideto.min.js diff --git a/utils/test/testapi/3rd_party/static/lib/jquery.wiggle.min.js b/utils/test/testapi/3rd_party/static/swagger/lib/jquery.wiggle.min.js index 2adb0d6d5..2adb0d6d5 100644 --- a/utils/test/testapi/3rd_party/static/lib/jquery.wiggle.min.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/jquery.wiggle.min.js diff --git a/utils/test/testapi/3rd_party/static/lib/shred.bundle.js b/utils/test/testapi/3rd_party/static/swagger/lib/shred.bundle.js index 74d081689..74d081689 100644 --- a/utils/test/testapi/3rd_party/static/lib/shred.bundle.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/shred.bundle.js diff --git a/utils/test/testapi/3rd_party/static/lib/shred/content.js b/utils/test/testapi/3rd_party/static/swagger/lib/shred/content.js index b8051fedd..b8051fedd 100644 --- a/utils/test/testapi/3rd_party/static/lib/shred/content.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/shred/content.js diff --git a/utils/test/testapi/3rd_party/static/lib/swagger-oauth.js b/utils/test/testapi/3rd_party/static/swagger/lib/swagger-oauth.js index 7c8839a95..7c8839a95 100644 --- a/utils/test/testapi/3rd_party/static/lib/swagger-oauth.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/swagger-oauth.js diff --git a/utils/test/testapi/3rd_party/static/lib/swagger.js b/utils/test/testapi/3rd_party/static/swagger/lib/swagger.js index 78e8b2949..78e8b2949 100644 --- a/utils/test/testapi/3rd_party/static/lib/swagger.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/swagger.js diff --git a/utils/test/testapi/3rd_party/static/lib/underscore-min.js b/utils/test/testapi/3rd_party/static/swagger/lib/underscore-min.js index 5a0cb3b00..5a0cb3b00 100644 --- a/utils/test/testapi/3rd_party/static/lib/underscore-min.js +++ b/utils/test/testapi/3rd_party/static/swagger/lib/underscore-min.js diff --git a/utils/test/testapi/3rd_party/static/o2c.html b/utils/test/testapi/3rd_party/static/swagger/o2c.html index d32d130ec..d32d130ec 100644 --- a/utils/test/testapi/3rd_party/static/o2c.html +++ b/utils/test/testapi/3rd_party/static/swagger/o2c.html diff --git a/utils/test/testapi/3rd_party/static/swagger-ui.js b/utils/test/testapi/3rd_party/static/swagger/swagger-ui.js index 4c9922642..4c9922642 100644 --- a/utils/test/testapi/3rd_party/static/swagger-ui.js +++ b/utils/test/testapi/3rd_party/static/swagger/swagger-ui.js diff --git a/utils/test/testapi/3rd_party/static/swagger-ui.min.js b/utils/test/testapi/3rd_party/static/swagger/swagger-ui.min.js index 28cb9e6a4..28cb9e6a4 100644 --- a/utils/test/testapi/3rd_party/static/swagger-ui.min.js +++ b/utils/test/testapi/3rd_party/static/swagger/swagger-ui.min.js diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/app.js b/utils/test/testapi/3rd_party/static/testapi-ui/app.js index 91e53f49a..4a2f23af9 100644 --- a/utils/test/testapi/3rd_party/static/testapi-ui/app.js +++ b/utils/test/testapi/3rd_party/static/testapi-ui/app.js @@ -37,56 +37,56 @@ $stateProvider. state('home', { url: '/', - templateUrl: '/swagger/testapi-ui/components/home/home.html' + templateUrl: '/testapi-ui/components/home/home.html' }). state('about', { url: '/about', - templateUrl: '/swagger/testapi-ui/components/about/about.html' + templateUrl: '/testapi-ui/components/about/about.html' }). state('guidelines', { url: '/guidelines', - templateUrl: '/swagger/testapi-ui/components/guidelines/guidelines.html', + templateUrl: '/testapi-ui/components/guidelines/guidelines.html', controller: 'GuidelinesController as ctrl' }). state('communityResults', { url: '/community_results', - templateUrl: '/swagger/testapi-ui/components/results/results.html', + templateUrl: '/testapi-ui/components/results/results.html', controller: 'ResultsController as ctrl' }). state('userResults', { url: '/user_results', - templateUrl: '/swagger/testapi-ui/components/results/results.html', + templateUrl: '/testapi-ui/components/results/results.html', controller: 'ResultsController as ctrl' }). state('resultsDetail', { url: '/results/:testID', - templateUrl: '/swagger/testapi-ui/components/results-report' + + templateUrl: '/testapi-ui/components/results-report' + '/resultsReport.html', controller: 'ResultsReportController as ctrl' }). state('profile', { url: '/profile', - templateUrl: '/swagger/testapi-ui/components/profile/profile.html', + templateUrl: '/testapi-ui/components/profile/profile.html', controller: 'ProfileController as ctrl' }). state('authFailure', { url: '/auth_failure', - templateUrl: '/swagger/testapi-ui/components/home/home.html', + templateUrl: '/testapi-ui/components/home/home.html', controller: 'AuthFailureController as ctrl' }). state('logout', { url: '/logout', - templateUrl: '/swagger/testapi-ui/components/logout/logout.html', + templateUrl: '/testapi-ui/components/logout/logout.html', controller: 'LogoutController as ctrl' }). state('userVendors', { url: '/user_vendors', - templateUrl: '/swagger/testapi-ui/components/vendors/vendors.html', + templateUrl: '/testapi-ui/components/vendors/vendors.html', controller: 'VendorsController as ctrl' }). state('publicVendors', { url: '/public_vendors', - templateUrl: '/swagger/testapi-ui/components/vendors/vendors.html', + templateUrl: '/testapi-ui/components/vendors/vendors.html', controller: 'VendorsController as ctrl' }). state('vendor', { @@ -96,22 +96,22 @@ }). state('userProducts', { url: '/user_products', - templateUrl: '/swagger/testapi-ui/components/products/products.html', + templateUrl: '/testapi-ui/components/products/products.html', controller: 'ProductsController as ctrl' }). state('publicProducts', { url: '/public_products', - templateUrl: '/swagger/testapi-ui/components/products/products.html', + templateUrl: '/testapi-ui/components/products/products.html', controller: 'ProductsController as ctrl' }). state('cloud', { url: '/cloud/:id', - templateUrl: '/swagger/testapi-ui/components/products/cloud.html', + templateUrl: '/testapi-ui/components/products/cloud.html', controller: 'ProductController as ctrl' }). state('distro', { url: '/distro/:id', - templateUrl: '/swagger/testapi-ui/components/products/distro.html', + templateUrl: '/testapi-ui/components/products/distro.html', controller: 'ProductController as ctrl' }); } @@ -211,7 +211,7 @@ angular.bootstrap(document, ['testapiApp']); } - $http.get('swagger/testapi-ui/config.json').success(function (data) { + $http.get('testapi-ui/config.json').success(function (data) { startApp(data); }).error(function () { startApp({}); diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/index.html b/utils/test/testapi/3rd_party/static/testapi-ui/index.html index 4bf3c0d1b..46ccc61b8 100644 --- a/utils/test/testapi/3rd_party/static/testapi-ui/index.html +++ b/utils/test/testapi/3rd_party/static/testapi-ui/index.html @@ -21,39 +21,39 @@ <meta name="viewport" content="width=device-width"> <title>TestAPI</title> - <link rel="icon" type="image/png" href="swagger/testapi-ui/favicon-16x16.png" sizes="16x16" /> - <link rel="icon" type="image/png" href="swagger/testapi-ui/favicon-32x32.png" sizes="32x32" /> + <link rel="icon" type="image/png" href="testapi-ui/favicon-16x16.png" sizes="16x16" /> + <link rel="icon" type="image/png" href="testapi-ui/favicon-32x32.png" sizes="32x32" /> - <link rel="stylesheet" href="swagger/testapi-ui/assets/lib/bootstrap/dist/css/bootstrap.min.css"> - <link rel="stylesheet" href="swagger/testapi-ui/assets/lib/angular-busy/dist/angular-busy.min.css"> - <link rel="stylesheet" href="swagger/testapi-ui/assets/css/style.css"> + <link rel="stylesheet" href="testapi-ui/assets/lib/bootstrap/dist/css/bootstrap.min.css"> + <link rel="stylesheet" href="testapi-ui/assets/lib/angular-busy/dist/angular-busy.min.css"> + <link rel="stylesheet" href="testapi-ui/assets/css/style.css"> - <script src="swagger/testapi-ui/assets/lib/angular/angular.min.js"></script> - <script src="swagger/testapi-ui/assets/lib/angular-ui-router/release/angular-ui-router.min.js"></script> - <script src="swagger/testapi-ui/assets/lib/angular-resource/angular-resource.min.js"></script> - <script src="swagger/testapi-ui/assets/lib/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> - <script src="swagger/testapi-ui/assets/lib/angular-busy/dist/angular-busy.min.js"></script> - <script src="swagger/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js"></script> - <script src="swagger/testapi-ui/app.js"></script> + <script src="testapi-ui/assets/lib/angular/angular.min.js"></script> + <script src="testapi-ui/assets/lib/angular-ui-router/release/angular-ui-router.min.js"></script> + <script src="testapi-ui/assets/lib/angular-resource/angular-resource.min.js"></script> + <script src="testapi-ui/assets/lib/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> + <script src="testapi-ui/assets/lib/angular-busy/dist/angular-busy.min.js"></script> + <script src="testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js"></script> + <script src="testapi-ui/app.js"></script> <!-- Controllers --> - <script src="swagger/testapi-ui/shared/header/headerController.js"></script> - <script src="swagger/testapi-ui/shared/alerts/alertModalFactory.js"></script> - <script src="swagger/testapi-ui/shared/alerts/confirmModalFactory.js"></script> - <script src="swagger/testapi-ui/components/guidelines/guidelinesController.js"></script> - <script src="swagger/testapi-ui/components/results/resultsController.js"></script> - <script src="swagger/testapi-ui/components/results-report/resultsReportController.js"></script> - <script src="swagger/testapi-ui/components/profile/profileController.js"></script> - <script src="swagger/testapi-ui/components/auth-failure/authFailureController.js"></script> - <script src="swagger/testapi-ui/components/logout/logoutController.js"></script> + <script src="testapi-ui/shared/header/headerController.js"></script> + <script src="testapi-ui/shared/alerts/alertModalFactory.js"></script> + <script src="testapi-ui/shared/alerts/confirmModalFactory.js"></script> + <script src="testapi-ui/components/guidelines/guidelinesController.js"></script> + <script src="testapi-ui/components/results/resultsController.js"></script> + <script src="testapi-ui/components/results-report/resultsReportController.js"></script> + <script src="testapi-ui/components/profile/profileController.js"></script> + <script src="testapi-ui/components/auth-failure/authFailureController.js"></script> + <script src="testapi-ui/components/logout/logoutController.js"></script> <!-- Filters --> - <script src="swagger/testapi-ui/shared/filters.js"></script> + <script src="testapi-ui/shared/filters.js"></script> </head> <body class="container"> - <header ng-include src="'swagger/testapi-ui/shared/header/header.html'"></header> + <header ng-include src="'testapi-ui/shared/header/header.html'"></header> <div ui-view></div> </body> diff --git a/utils/test/testapi/install.sh b/utils/test/testapi/install.sh index bf828b580..d470e38c3 100755 --- a/utils/test/testapi/install.sh +++ b/utils/test/testapi/install.sh @@ -11,7 +11,6 @@ where: -h|--help show this help text" # Ref :- https://openstack.nimeyo.com/87286/openstack-packaging-all-definition-data-files-config-setup - if [ -z "$VIRTUAL_ENV" ]; then if [[ $(whoami) != "root" ]]; @@ -23,9 +22,9 @@ else sed -i -e 's#/etc/opnfv_testapi =#etc/opnfv_testapi =#g' setup.cfg fi -cp -fr 3rd_party/static opnfv_testapi/tornado_swagger +cp -fr 3rd_party/static opnfv_testapi/static python setup.py install -rm -fr opnfv_testapi/tornado_swagger/static +rm -fr opnfv_testapi/static if [ ! -z "$VIRTUAL_ENV" ]; then sed -i -e 's#etc/opnfv_testapi =#/etc/opnfv_testapi =#g' setup.cfg fi
\ No newline at end of file diff --git a/utils/test/testapi/opnfv_testapi/cmd/server.py b/utils/test/testapi/opnfv_testapi/cmd/server.py index 8b092b89e..2696bb397 100644 --- a/utils/test/testapi/opnfv_testapi/cmd/server.py +++ b/utils/test/testapi/opnfv_testapi/cmd/server.py @@ -58,7 +58,8 @@ def get_db(): def make_app(): - swagger.docs(base_url=CONF.swagger_base_url) + swagger.docs(base_url=CONF.swagger_base_url, + static_path=CONF.static_path) return swagger.Application( url_mappings.mappings, db=get_db(), diff --git a/utils/test/testapi/opnfv_testapi/common/config.py b/utils/test/testapi/opnfv_testapi/common/config.py index 70d7bd63f..46765ffd1 100644 --- a/utils/test/testapi/opnfv_testapi/common/config.py +++ b/utils/test/testapi/opnfv_testapi/common/config.py @@ -17,6 +17,10 @@ class Config(object): def __init__(self): self.file = self.CONFIG if self.CONFIG else self._default_config() self._parse() + self.static_path = os.path.join( + os.path.dirname(os.path.normpath(__file__)), + os.pardir, + 'static') def _parse(self): if not os.path.exists(self.file): diff --git a/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py b/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py index ac8f816a4..4c14802c4 100644 --- a/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/ui_handlers.py @@ -1,14 +1,11 @@ from opnfv_testapi.resources.handlers import GenericApiHandler -from opnfv_testapi.tornado_swagger import settings +from opnfv_testapi.common import config class UIHandler(GenericApiHandler): - def initialize(self, **kwargs): - self.static_path = settings.docs_settings.get('static_path') - self.base_url = 'http://localhost:8000' def get_template_path(self): - return self.static_path + return config.Config().static_path def get(self): self.render('testapi-ui/index.html') diff --git a/utils/test/testapi/opnfv_testapi/router/url_mappings.py b/utils/test/testapi/opnfv_testapi/router/url_mappings.py index 94e71c62d..ebe59941a 100644 --- a/utils/test/testapi/opnfv_testapi/router/url_mappings.py +++ b/utils/test/testapi/opnfv_testapi/router/url_mappings.py @@ -6,6 +6,9 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +import tornado.web + +from opnfv_testapi.common import config from opnfv_testapi.resources import handlers from opnfv_testapi.resources import pod_handlers from opnfv_testapi.resources import project_handlers @@ -49,4 +52,9 @@ mappings = [ # scenarios (r"/api/v1/scenarios", scenario_handlers.ScenariosCLHandler), (r"/api/v1/scenarios/([^/]+)", scenario_handlers.ScenarioGURHandler), + + # static path + (r'/(.*\.(css|png|gif|js|html|json))', + tornado.web.StaticFileHandler, + {'path': config.Config().static_path}), ] diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/test_base.py b/utils/test/testapi/opnfv_testapi/tests/unit/test_base.py index a6e733914..4d3445659 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/test_base.py +++ b/utils/test/testapi/opnfv_testapi/tests/unit/test_base.py @@ -12,10 +12,13 @@ from os import path import mock from tornado import testing -from opnfv_testapi.cmd import server +from opnfv_testapi.common import config from opnfv_testapi.resources import models from opnfv_testapi.tests.unit import fake_pymongo +config.Config.CONFIG = path.join(path.dirname(__file__), + '../../../etc/config.ini') + class TestBase(testing.AsyncHTTPTestCase): headers = {'Content-Type': 'application/json; charset=UTF-8'} @@ -36,6 +39,7 @@ class TestBase(testing.AsyncHTTPTestCase): self.db_patcher.stop() def _patch_server(self): + from opnfv_testapi.cmd import server server.parse_config([ '--config-file', path.join(path.dirname(__file__), 'common/normal.ini') @@ -49,6 +53,7 @@ class TestBase(testing.AsyncHTTPTestCase): return fake_pymongo def get_app(self): + from opnfv_testapi.cmd import server return server.make_app() def create_d(self, *args): diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py index c9c8a0863..e39a9f639 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py +++ b/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py @@ -35,8 +35,4 @@ def swagger_handlers(): views.SwaggerApiHandler, settings.docs_settings, name=settings.API_DECLARATION_NAME), - ( - _path(r'(.*\.(css|png|gif|js|html|json))'), - tornado.web.StaticFileHandler, - {'path': settings.docs_settings.get('static_path')}), ] diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py index 03e9bbdff..284226116 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py +++ b/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py @@ -6,17 +6,14 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import os.path API_DOCS_NAME = 'swagger-api-docs' RESOURCE_LISTING_NAME = 'swagger-resource-listing' API_DECLARATION_NAME = 'swagger-api-declaration' -STATIC_PATH = os.path.join(os.path.dirname(os.path.normpath(__file__)), - 'static') docs_settings = { 'base_url': '', - 'static_path': STATIC_PATH, + 'static_path': '', 'swagger_prefix': '/swagger', 'api_version': 'v1.0', 'swagger_version': '1.2', diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py index 42b37483b..793999700 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py +++ b/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py @@ -33,7 +33,7 @@ class SwaggerUIHandler(tornado.web.RequestHandler): def get(self): resource_url = self.reverse_url(settings.RESOURCE_LISTING_NAME) discovery_url = self.base_url + resource_url - self.render('index.html', discovery_url=discovery_url) + self.render('swagger/index.html', discovery_url=discovery_url) class SwaggerResourcesHandler(tornado.web.RequestHandler): diff --git a/utils/test/testapi/setup.cfg b/utils/test/testapi/setup.cfg index bfa534fb5..ab1ef553e 100644 --- a/utils/test/testapi/setup.cfg +++ b/utils/test/testapi/setup.cfg @@ -25,19 +25,13 @@ packages = opnfv_testapi package_data = opnfv_testapi = - tornado_swagger/static/*.* - tornado_swagger/static/css/*.* - tornado_swagger/static/images/*.* - tornado_swagger/static/lib/*.* - tornado_swagger/static/lib/shred/*.* - tornado_swagger/static/testapi-ui/*.* - tornado_swagger/static/testapi-ui/components/*/*.* - tornado_swagger/static/testapi-ui/assets/*/*.* - tornado_swagger/static/testapi-ui/assets/*/*/*.* - tornado_swagger/static/testapi-ui/assets/*/*/*/*.* - tornado_swagger/static/testapi-ui/assets/*/*/*/*/*.* - tornado_swagger/static/testapi-ui/shared/*.* - tornado_swagger/static/testapi-ui/shared/*/*.* + static/*.* + static/*/*.* + static/*/*/*.* + static/*/*/*/*.* + static/*/*/*/*/*.* + static/*/*/*/*/*/*.* + static/*/*/*/*/*/*/*.* data_files = /etc/opnfv_testapi = etc/config.ini |