def test_login_username(self): print('获取用户名222222') # 预期结果:自己登录的账号 expect_username = '******' # 实际结果:显示在页面的账号 actual_username = get_username() self.assertEqual(expect_username, actual_username)
def test_login_username(self): print("获取用户名测试用例") # 预期结果: 自己登陆的账号 expect_username = '******' # 实际结果 : 显示在页面上的账号 acutl_username = get_username() self.assertEqual(expect_username,acutl_username)
def test_login_username(): # 登录用户名 # 预期结果:自己登陆的账号 except_useranme = 'test01' # 实际结果:显示在页面上的账号 actual_name = get_username() # 比较预期结果与实际结果 assert except_useranme == actual_name
def test_login_username(self): # 登录用户名 # 预期结果:自己登陆的账号 except_useranme = 'test01' # 实际结果:显示在页面上的账号 actual_name = get_username() # 比较预期结果与实际结果 self.assertEqual(except_useranme, actual_name) # assertEqual(a, b) 比较a b两个值是否相等
def test_login_username(self): print('获取用户名测试用例') # 每个测试方法,都是以test开头 # 预期结果 : 本人登录的账号 expect_username = '******' # 实际结果 : 显示在页面上的账号 acut_username = get_username() # assert expect_username == acut_username self.assertEqual(expect_username, acut_username)
def main(): init("main") with h.tag("html"): header("main") with h.tag("body"): with h.tag("h1"): h.content("Krampus Hack 2018") whose = request.args.get("whose", None) with h.tag("form", action="/arena"): if whose: h.tag2("input", type="hidden", name="player", value=whose) h.tag2("input", type="submit", value="To Arena") with h.tag("form", action="/lab"): h.tag2("input", type="submit", value="To Lab") with h.tag("h2"): h.content("Multiplayer") username = login.get_username(h) if username: with h.tag("h3"): h.content("Join Game") with h.tag("p"): h.content( "Join someone else's game if you know their name.") with h.tag("form", action="/arena"): h.tag2("input", name="player", value="name of friend") h.tag2("input", type="submit", value="Join Game") with h.tag("h3"): h.content("Start Game") with h.tag("p"): h.content( "Start a new game and tell other players to join " + username + ".") with h.tag("form", action="/arena/start"): h.tag2("input", type="submit", value="Start Game") with h.tag("h2"): h.content("Happy Holidays Amarillion!") with h.tag("p"): h.content(""" In this game you play a mad <b>scientist</b> who discovered how to edit the genome of his magical pet. Initially a <b>cute animal</b> it soon is transformed into a fighting beast battling monsters together with <b>multiple players</b>. """) return r
def test_login_username(): # 预期结果:自己登录的账号 expect_username = '******' # 实际结果:显示在页面上的账号 acutl_username = get_username() assert expect_username == acutl_username
def test_login_username(): # 预期结果:自己登录的账号 expect_username = '******' # 实际结果:显示在页面的账号 actual_username = login.get_username() assert expect_username == actual_username
def test_login_username(self): # 预期结果:自己登录的账号 expect_username = '******' # 实际结果:显示在页面上的账号 acutl_username = get_username() self.assertEqual(expect_username, acutl_username)