Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
 def buildJSONObject(self):
     call = Call(self.url)
     return call.get()
Ejemplo n.º 5
0
def getIOList(ioType):
    url = "{}{}s".format(globalConfig.apiUrl, ioType)
    call = Call(url)
    call.expectedCode = 200
    response = call.get()
    return trimTrailingSlashesInList(response)
Ejemplo n.º 6
0
 def getIOAsJSON(self):
     ioResourceURL = "{}{}".format(self.url, "io")
     call = Call(ioResourceURL)
     return call.get()