本文整理汇总了Python中pyxmpp.iq.Iq.set_new_content方法的典型用法代码示例。如果您正苦于以下问题:Python Iq.set_new_content方法的具体用法?Python Iq.set_new_content怎么用?Python Iq.set_new_content使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyxmpp.iq.Iq
的用法示例。
在下文中一共展示了Iq.set_new_content方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MailCommandManagerTestCase
# 需要导入模块: from pyxmpp.iq import Iq [as 别名]
# 或者: from pyxmpp.iq.Iq import set_new_content [as 别名]
class MailCommandManagerTestCase(JCLCommandManagerTestCase):
def setUp(self, tables=[]):
tables += [POP3Account, IMAPAccount, GlobalSMTPAccount,
AbstractSMTPAccount, SMTPAccount,
MailAccount, MockIMAPAccount, User, Account, PresenceAccount]
JCLTestCase.setUp(self, tables=tables)
self.config_file = tempfile.mktemp(".conf", "jmctest", jcl.tests.DB_DIR)
self.config = ConfigParser()
self.config.read(self.config_file)
self.comp = MailComponent("jmc.test.com",
"password",
"localhost",
"5347",
self.config,
self.config_file)
self.comp.set_admins(["[email protected]"])
self.command_manager = MailCommandManager(self.comp,
self.comp.account_manager)
self.comp.account_manager.account_classes = (POP3Account, IMAPAccount,
GlobalSMTPAccount,
AbstractSMTPAccount,
SMTPAccount, MockIMAPAccount)
self.user1 = User(jid="[email protected]")
self.account11 = MockIMAPAccount(user=self.user1,
name="account11",
jid="[email protected]" + unicode(self.comp.jid))
self.account12 = MockIMAPAccount(user=self.user1,
name="account12",
jid="[email protected]" + unicode(self.comp.jid))
self.user2 = User(jid="[email protected]")
self.account21 = MockIMAPAccount(user=self.user2,
name="account21",
jid="[email protected]" + unicode(self.comp.jid))
self.account22 = MockIMAPAccount(user=self.user2,
name="account11",
jid="[email protected]" + unicode(self.comp.jid))
self.user3 = User(jid="[email protected]")
self.account31 = MockIMAPAccount(user=self.user3,
name="account31",
jid="[email protected]" + unicode(self.comp.jid))
self.account32 = MockIMAPAccount(user=self.user3,
name="account32",
jid="[email protected]" + unicode(self.comp.jid))
self.info_query = Iq(stanza_type="set",
from_jid="[email protected]",
to_jid=self.comp.jid)
self.command_node = self.info_query.set_new_content(command.COMMAND_NS,
"command")
class MockFeederHandler(Feeder):
def __init__(self, component):
Feeder.__init__(self, component)
self.checked_accounts = []
def feed(self, _account):
self.checked_accounts.append(_account)
assert((int(time.time()) - _account.lastcheck \
>= (_account.interval * self.component.time_unit)))
return []
self.comp.tick_handlers[0].feeder = MockFeederHandler(self.comp)
def tearDown(self):
JCLTestCase.tearDown(self)
if os.path.exists(self.config_file):
os.unlink(self.config_file)