本文整理汇总了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'))
示例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:
示例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)