def get_room(self, roomId): new_room = None _rooms = yield from self._rooms.get_resources() if _rooms: for _room in _rooms[ATTR_ROOM_DATA]: if _room[ATTR_ID] == roomId: new_room = Room(_room, **self._connection_data) break return new_room
def _resource_factory(self, raw): return Room(raw, self.request)
def create_room(self, roomname): _newroom = yield from self._rooms.create_room(roomname) if _newroom: return Room(_newroom, **self._connection_data) return None
async def go(): await self.start_fake_server() room = Room(self.get_resource_raw_data(), self.request) room._resource_path += '1' resp = await room.delete() return resp
def get_resource(self): _request = Mock() _request.hub_ip = FAKE_BASE_URL return Room(ROOM_RAW_DATA, _request)