コード例 #1
0
ファイル: test_case2.py プロジェクト: epsonzzc/demo_unittest
    def test_login_password(self):
        print('获取密码22222')
        # 预期结果:自己登录的密码
        expect_password = '******'
        # 实际结果:显示在页面的密码
        actual_password = get_password()
        self.assertEqual(expect_password, actual_password)
        # assert expect_password == actual_password


# if __name__ == '__main__':
# test_login_username()
# test_login_password()
# unittest.main()

# 创建一个测试套件,相当于一组用例
# suite = unittest.TestSuite()
# suite.addTest(TestLogin('test_login_username'))
# suite.addTest(TestLogin('test_login_password'))
#
# runner = unittest.TextTestRunner()
# runner.run(suite)

# if __name__ == '__main__':
#
# # 使用TestLoader
#     suite = unittest.TestLoader().discover('.',pattern='test*.py')
#     runner = unittest.TextTestRunner()
#     runner.run(suite)
コード例 #2
0
 def test_login_password(self):
     print("获取密码测试用例")
     # 预期结果:登入的密码
     expect_password = '******'
     # 实际结果:显示在页面上的密码
     acutl_password = get_password()
     self.assertEqual(acutl_password, expect_password)
コード例 #3
0
def test_login_password():   # 登录密码
    # 预期结果:自己登陆的密码
    except_password = '******'
    # 实际结果:显示在页面上的密码
    actual_password = get_password()
    # 比较预期结果与实际结果
    assert except_password == actual_password
コード例 #4
0
 def test_login_password(self):
     print('获取密码33333')
     # 预期结果:自己登录的密码
     expect_password = '******'
     # 实际结果:显示在页面的密码
     actual_password = get_password()
     self.assertEqual(expect_password,actual_password)
コード例 #5
0
ファイル: test_case3.py プロジェクト: zh199626/unittest_01
 def test_login_password(self):
     print('获取密码测试用例')
     # 预期结果 :自己登录的密码
     expect_password = '******'
     # 实际结果 :显示在页面上的密码
     acutl_password = get_password()
     self.assertEqual(expect_password, acutl_password)
コード例 #6
0
ファイル: test_case2.py プロジェクト: liang-1998/unittest
 def test_login_password(self):  # 登录密码
     # 预期结果:自己登陆的密码
     except_password = '******'
     # 实际结果:显示在页面上的密码
     actual_password = get_password()
     # 比较预期结果与实际结果
     self.assertEqual(except_password, actual_password)
コード例 #7
0
ファイル: test_case_02.py プロジェクト: ss3931/jekins_unitest
 def test_login_password(self):
     print('获取密码测试用例')
     # 预期结果 : 本人登录账号的密码
     expect_password = '******'
     # 实际结果 : 显示在页面上的密码
     acut_password = get_password()
     # assert expect_password == acut_password
     self.assertEqual(expect_password, acut_password)
コード例 #8
0
def connect_clients(clients, cpps, remember):
    count = len(clients)
    print "Logging in with {} penguin{}...".format(count,
                                                   "s" if count > 1 else "")
    filename = os.path.join(os.path.dirname(__file__), "json/penguins.json")
    try:
        with open(filename) as file:
            data = json.load(file)
    except:
        data = {}

    if cpps in data:
        for user, password in data[cpps].iteritems():
            try:
                clients[count - 1].connect(user, password, True)
            except ClientError as e:
                print "{}: {}".format(user, e.message)
                if e.code == 603:
                    login.remove_penguin(cpps, user, data)
                continue
            count -= 1
            if count == 0:
                break
            print "Connected! ({} left)\r".format(count),

    i = 0
    while i < count:
        user = raw_input("Username: "******"Connecting..."
        try:
            clients[i].connect(user, password)
        except ClientError as e:
            print e.message
            continue
        i += 1
        if i < count:
            print "Connected! ({} left)".format(count - i)
    print "All connected!      "
コード例 #9
0
def test_login_password():
    # 预期结果:自己登录的密码
    expect_password = '******'
    # 实际结果:显示在页面的密码
    acutl_password = get_password()
    assert expect_password == acutl_password
コード例 #10
0
			if error:
				print "Username: "******"All connected!"
					break
				else:
					print "Connected! (" + str(count) + " left)"
	
	i = 0
	while i < count:
		user = raw_input("Username: "******"Connecting..."
		error = clients[i].connect(user, password)
		if not error:
			i += 1
			if i < count:
				print "Connected! (" + str(count - i) + " left)"
			else:
				print "All connected!"
	
	for client in clients:
		client.update_color(shape["color"])
		client.update_head(shape["head"])
		client.update_face(shape["face"])
		client.update_neck(shape["neck"])
		client.update_body(shape["body"])
コード例 #11
0
def test_login_password():
    # 预期结果:自己登录的密码
    expect_password = '******'
    # 实际结果:显示在页面的密码
    actual_password = login.get_password()
    assert expect_password == actual_password
コード例 #12
0
ファイル: test_case3.py プロジェクト: zbm1012/python_unittest
 def test_login_password(self):
     # 预期结果:自己登录的密码
     expect_password = '******'
     # 实际结果:显示在页面的密码
     acutl_password = get_password()
     self.assertEqual(expect_password, acutl_password)
コード例 #13
0
ファイル: test_case1.py プロジェクト: 1069288558/demo_unitest
def test_login_password():
    #预期结果:登入的密码
    expect_password = '******'
    #实际结果:显示在页面上的密码
    acutl_password = get_password()
    assert expect_password == acutl_password
コード例 #14
0
 def test_login_password(self):
     expect_password = '******'  # 预期结果 :自己登录的密码
     acutl_password = get_password()  # 实际结果 :显示在页面上的密码
     self.assertEqual(expect_password, acutl_password)