示例#1
0
 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
示例#2
0
 def _resource_factory(self, raw):
     return Room(raw, self.request)
示例#3
0
 def create_room(self, roomname):
     _newroom = yield from self._rooms.create_room(roomname)
     if _newroom:
         return Room(_newroom, **self._connection_data)
     return None
示例#4
0
 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
示例#5
0
 def get_resource(self):
     _request = Mock()
     _request.hub_ip = FAKE_BASE_URL
     return Room(ROOM_RAW_DATA, _request)