Ejemplo n.º 1
0
def get(id):
    '''
    Gets a device from LajiStore
    :param id: The LajiStore ID of the device
    :return: A Device object
    '''
    device = LajiStoreAPI.get_device(id)
    return Device(**device)
Ejemplo n.º 2
0
    def testLajiStoreDevice(self):
        response = LajiStoreAPI.post_device(**self.device)
        self.assertEquals(True, "id" in response)

        response = LajiStoreAPI.get_device(response["id"])
        self.assertEquals(True, "id" in response)

        self.device["id"] = response["id"]
        response = LajiStoreAPI.update_device(**self.device)
        self.assertEquals(True, "id" in response)

        response = LajiStoreAPI.delete_device(response["id"])
        self.assertEquals(204, response.status_code)