Commit 9708268f authored by Yann Garcia's avatar Yann Garcia

Add TC_MEC_SRV_RNIS_011_OK

parent a84df257
......@@ -209,7 +209,8 @@ class mec_database:
# End of method getAccessPointList
def getSubscriptionLinkList(self, p_uri):
return "{\"SubscriptionLinkList\": {\"_links\": {\"self\": \"http://example.com" + p_uri + "\"},\"subscription\": [{\"href\": \"http://meAppClient.example.com/rni/v1/notifications/cell_change/77777\",\"subscriptionType\": \"CELL_CHANGE\"},{\"href\": \"http://meAppClient.example.com/rni/v1/notifications/MeasTa/77777\",\"subscriptionType\": \"MEAS_TIMING_ADVANCE\"}]}}"
s = p_uri.split('?')
return "{\"SubscriptionLinkList\": {\"_links\": {\"self\": \"http://example.com" + s[0] + "\"},\"subscription\": [{\"href\": \"http://meAppClient.example.com/rni/v1/notifications/cell_change/77777\",\"subscriptionType\": \"CELL_CHANGE\"},{\"href\": \"http://meAppClient.example.com/rni/v1/notifications/MeasTa/77777\",\"subscriptionType\": \"MEAS_TIMING_ADVANCE\"}]}}"
# End of method getSubscriptionLinkList
def getMp1TransportInfoList(self):
......
......@@ -391,7 +391,22 @@ class myHandler(http.server.BaseHTTPRequestHandler):
resp = None
content_type = 'application/json'
if p_split[4].startswith('subscriptions'):
if p_split.__len__() == 6:
if p_split.__len__() == 5:
s = p_split[4].split('?')
if s.__len__() == 1:
resp = self.__db__.getSubscriptionLinkList(self.path)
elif s[0] != 'subscriptions':
resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
content_type = 'application/problem+json'
else:
s = s[1].split('=')
print('__process__rnis__api__: ', s)
if s[0] != 'subscription_type':
resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
content_type = 'application/problem+json'
else:
resp = self.__db__.getSubscriptionLinkList(self.path)
elif p_split.__len__() == 6:
if p_split[5] == '':
resp = self.__db__.getSubscriptionLinkList(self.path)
if (resp == None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment