X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FRequestsLibrary.py;h=e79b4da7a58d6cf2125c1851f22bc024d95a6883;hb=4811fa54cb585ce14d3b6280beda13af4985234c;hp=e120972c6dd8a79eb332798c2214ce41a5743c65;hpb=59e81c38620fa1b61e15771191e35771450b9499;p=integration%2Ftest.git diff --git a/csit/libraries/RequestsLibrary.py b/csit/libraries/RequestsLibrary.py index e120972c6d..e79b4da7a5 100644 --- a/csit/libraries/RequestsLibrary.py +++ b/csit/libraries/RequestsLibrary.py @@ -1,5 +1,6 @@ import requests import json +import warnings from urllib import urlencode @@ -95,7 +96,10 @@ class RequestsLibrary(object): `headers` a dictionary of headers to use with the request """ - + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) session = self._cache.switch(alias) resp = session.get(self._get_url(session, uri), headers=headers, @@ -121,6 +125,10 @@ class RequestsLibrary(object): `files` a dictionary of file names containing file data to POST to the server """ + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) session = self._cache.switch(alias) data = self._utf8_urlencode(data) @@ -150,6 +158,10 @@ class RequestsLibrary(object): `files` a dictionary of file names containing file data to POST to the server """ + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) session = self._cache.switch(alias) data = json.dumps(data) @@ -174,6 +186,10 @@ class RequestsLibrary(object): """ + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) session = self._cache.switch(alias) # data = self._utf8_urlencode(data) data = json.dumps(data) @@ -199,6 +215,10 @@ class RequestsLibrary(object): """ + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) session = self._cache.switch(alias) data = self._utf8_urlencode(data) # data = json.dumps(data) @@ -224,6 +244,10 @@ class RequestsLibrary(object): """ + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) session = self._cache.switch(alias) args = "?%s" % urlencode(data) if data else '' resp = session.delete("%s%s" % (self._get_url(session, uri), args),