当前位置: 首页>>代码示例>>Python>>正文


Python HomeServer.parse_roomid方法代码示例

本文整理汇总了Python中synapse.server.HomeServer.parse_roomid方法的典型用法代码示例。如果您正苦于以下问题:Python HomeServer.parse_roomid方法的具体用法?Python HomeServer.parse_roomid怎么用?Python HomeServer.parse_roomid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在synapse.server.HomeServer的用法示例。


在下文中一共展示了HomeServer.parse_roomid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from synapse.server import HomeServer [as 别名]
# 或者: from synapse.server.HomeServer import parse_roomid [as 别名]
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        self.mock_config = Mock()
        self.mock_config.signing_key = [MockKey()]

        hs = HomeServer(
            "test",
            db_pool=db_pool,
            config=self.mock_config,
            resource_for_federation=Mock(),
            http_client=None,
        )
        # We can't test the RoomMemberStore on its own without the other event
        # storage logic
        self.store = hs.get_datastore()
        self.event_builder_factory = hs.get_event_builder_factory()
        self.handlers = hs.get_handlers()
        self.message_handler = self.handlers.message_handler

        self.u_alice = hs.parse_userid("@alice:test")
        self.u_bob = hs.parse_userid("@bob:test")

        # User elsewhere on another host
        self.u_charlie = hs.parse_userid("@charlie:elsewhere")

        self.room = hs.parse_roomid("!abc123:test")
开发者ID:alisheikh,项目名称:synapse,代码行数:30,代码来源:test_roommember.py

示例2: setUp

# 需要导入模块: from synapse.server import HomeServer [as 别名]
# 或者: from synapse.server.HomeServer import parse_roomid [as 别名]
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        self.mock_config = Mock()
        self.mock_config.signing_key = [MockKey()]

        hs = HomeServer(
            "test",
            db_pool=db_pool,
            config=self.mock_config,
            resource_for_federation=Mock(),
            http_client=None,
        )

        self.store = hs.get_datastore()
        self.event_builder_factory = hs.get_event_builder_factory()
        self.handlers = hs.get_handlers()
        self.message_handler = self.handlers.message_handler

        self.u_alice = hs.parse_userid("@alice:test")
        self.u_bob = hs.parse_userid("@bob:test")

        self.room1 = hs.parse_roomid("!abc123:test")
        self.room2 = hs.parse_roomid("!xyx987:test")

        self.depth = 1
开发者ID:alisheikh,项目名称:synapse,代码行数:29,代码来源:test_stream.py

示例3: setUp

# 需要导入模块: from synapse.server import HomeServer [as 别名]
# 或者: from synapse.server.HomeServer import parse_roomid [as 别名]
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer("test",
            db_pool=db_pool,
        )

        self.store = DirectoryStore(hs)

        self.room = hs.parse_roomid("!abcde:test")
        self.alias = hs.parse_roomalias("#my-room:test")
开发者ID:uroborus,项目名称:synapse,代码行数:14,代码来源:test_directory.py

示例4: setUp

# 需要导入模块: from synapse.server import HomeServer [as 别名]
# 或者: from synapse.server.HomeServer import parse_roomid [as 别名]
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer(
            "test",
            db_pool=db_pool,
        )

        self.store = hs.get_datastore()
        self.event_factory = hs.get_event_factory()

        self.u_alice = hs.parse_userid("@alice:test")
        self.u_bob = hs.parse_userid("@bob:test")

        self.room1 = hs.parse_roomid("!abc123:test")

        self.depth = 1
开发者ID:gitter-badger,项目名称:synapse,代码行数:20,代码来源:test_redaction.py

示例5: setUp

# 需要导入模块: from synapse.server import HomeServer [as 别名]
# 或者: from synapse.server.HomeServer import parse_roomid [as 别名]
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer("test",
            db_pool=db_pool,
        )

        # Room events need the full datastore, for persist_event() and
        # get_room_state()
        self.store = hs.get_datastore()
        self.event_factory = hs.get_event_factory();

        self.room = hs.parse_roomid("!abcde:test")

        yield self.store.store_room(self.room.to_string(),
            room_creator_user_id="@creator:text",
            is_public=True
        )
开发者ID:alisheikh,项目名称:synapse,代码行数:21,代码来源:test_room.py

示例6: setUp

# 需要导入模块: from synapse.server import HomeServer [as 别名]
# 或者: from synapse.server.HomeServer import parse_roomid [as 别名]
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer("test",
            db_pool=db_pool,
        )

        # We can't test the RoomMemberStore on its own without the other event
        # storage logic
        self.store = hs.get_datastore()
        self.event_factory = hs.get_event_factory()

        self.u_alice = hs.parse_userid("@alice:test")
        self.u_bob = hs.parse_userid("@bob:test")

        # User elsewhere on another host
        self.u_charlie = hs.parse_userid("@charlie:elsewhere")

        self.room = hs.parse_roomid("!abc123:test")
开发者ID:esaul,项目名称:synapse,代码行数:22,代码来源:test_roommember.py


注:本文中的synapse.server.HomeServer.parse_roomid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。