From: Navneet Singh Date: Mon, 21 Oct 2013 20:11:11 +0000 (+0530) Subject: NetApp unit test fail fix for http_proxy X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6e3955e4cf2eaacd11adbc8df68e9d5d5e081f8f;p=openstack-build%2Fcinder-build.git NetApp unit test fail fix for http_proxy The environment having http_proxy settings caused the unit tests to fail with 404 error. This fix handles both situations with proxy or without proxy settings. Change-Id: I791a45adff654305db9f1fb6f039e91b11ba88d8 Closes-Bug:#1223145 --- diff --git a/cinder/tests/test_netapp.py b/cinder/tests/test_netapp.py index bba3a197f..fe3bb5512 100644 --- a/cinder/tests/test_netapp.py +++ b/cinder/tests/test_netapp.py @@ -97,7 +97,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -111,7 +111,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -683,7 +683,7 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -697,7 +697,7 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return diff --git a/cinder/tests/test_netapp_ssc.py b/cinder/tests/test_netapp_ssc.py index 4c10cac38..9d5f0b853 100644 --- a/cinder/tests/test_netapp_ssc.py +++ b/cinder/tests/test_netapp_ssc.py @@ -75,7 +75,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -89,7 +89,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return