def test_unload_preview(self):
        """
        Test the unloading of the preview community
        """
        def verify_unloaded(_):
            self.assertEqual(len(self.dispersy.get_communities()), 1)

        preview_member = DummyMember(self.dispersy, 2, "c" * 20)
        preview_community = PreviewChannelCommunity(self.dispersy, preview_member, self.member)
        preview_community.initialize()
        preview_community.init_timestamp = -500
        self.dispersy._communities['c' * 20] = preview_community
        return self.community.unload_preview().addCallback(verify_unloaded)
示例#2
0
    def test_unload_preview(self):
        """
        Test the unloading of the preview community
        """
        def verify_unloaded(_):
            self.assertEqual(len(self.dispersy.get_communities()), 1)

        preview_member = DummyMember(self.dispersy, 2, "c" * 20)
        preview_community = PreviewChannelCommunity(self.dispersy, preview_member, self.member)
        preview_community.initialize()
        preview_community.init_timestamp = -500
        self.dispersy._communities['c' * 20] = preview_community
        return self.community.unload_preview().addCallback(verify_unloaded)