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


Python Account.get_password方法代码示例

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


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

示例1: test_get_temp_password

# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import get_password [as 别名]
 def test_get_temp_password(self):
     url = 'wheeeeeeeeeeeee.com'
     username = 'helLo'
     password = None
     aa = Account(url, username, password)
     self.assertEqual(aa.get_password(), None)
     aa.set_temp_password('bleep')
     self.assertEqual(aa.get_password(), 'bleep')
     self.assertRaises(TempPasswordAlreadySetError, lambda: aa.set_temp_password('second bleep'))
开发者ID:jackdesert,项目名称:lyxblogger_oo,代码行数:11,代码来源:test_account.py

示例2:

# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import get_password [as 别名]
tn = telnetlib.Telnet(SITE_IP)
time.sleep(1)

# read content
content = tn.read_very_eager().decode('uao_decode', 'ignore')


# login
if '請輸入代號' in content:
    # write account id
    tn.write((account.get_account() + '\r\n').encode('big5'))
    time.sleep(1)
    content = tn.read_very_eager().decode('uao_decode', 'ignore')

    # write password
    tn.write((account.get_password() + '\r\n').encode('big5'))
    time.sleep(2)
    content = tn.read_very_eager().decode('uao_decode', 'ignore')

    # check if password incorrect
    if '密碼不對' in content:
        sys.exit()

    # check if exists a session
    if '您想刪除其他重複登入的連線嗎' in content:
        tn.write('Y\r\n'.encode('big5'))
        time.sleep(7)
        content = tn.read_very_eager().decode('uao_decode', 'ignore')

    # handle 'press any key'
    while '任意鍵' in content:
开发者ID:mhwong2007,项目名称:PTT-Crawler,代码行数:33,代码来源:ptt-crawler.py

示例3: test_password

# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import get_password [as 别名]
 def test_password(self):
     aa = Account('blah', 'barry', None)
     self.assertEqual(aa.get_password(), None)
     password = 'password'
     aa.set_password(password)
     self.assertEqual(aa.get_password(), password)
开发者ID:jackdesert,项目名称:lyxblogger_oo,代码行数:8,代码来源:test_account.py


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