def delete(self): url = self.urlBase + "map/activations/{}".format(self.activationID) deleteCall = Call(url) deleteCall.expectedCode = 204 deleteCall.string = True deleteCall.delete() deleteCall.expectedCode = 404 try: deleteCall.get() except NMOSTestException: msg = "Activation still present at {} after deletion".format(url) raise NMOSTestException(self.test.FAIL(msg))
def assembleInputObject(self): """Create JSON representation of an Input""" toReturn = {} resourceList = ['parent', 'channels', 'caps', 'properties'] for resource in resourceList: url = "{}/{}".format(self.url, resource) call = Call(url) toReturn[resource] = call.get() return toReturn
def assembleOutputObject(self): """Create JSON representation of an Output""" toReturn = {} resourceList = { 'sourceid': 'source_id', 'channels': 'channels', 'caps': 'caps', 'properties': 'properties' } for apiId, ioId in resourceList.items(): url = "{}{}".format(self.url, apiId) call = Call(url) toReturn[ioId] = call.get() if toReturn['source_id'] == "null": toReturn['source_id'] = None return toReturn
def buildJSONObject(self): call = Call(self.url) return call.get()
def getIOList(ioType): url = "{}{}s".format(globalConfig.apiUrl, ioType) call = Call(url) call.expectedCode = 200 response = call.get() return trimTrailingSlashesInList(response)
def getIOAsJSON(self): ioResourceURL = "{}{}".format(self.url, "io") call = Call(ioResourceURL) return call.get()