import requests
import unittest
class logintest1(unittest.TestCase):
def setUp(self):
self.test_url = "http://www.eebbk.com/"
def testlogin(self):
r = requests.get(self.test_url)
if r.status_code == int(200):
print(str(r.status_code)+" 第一条www.eebbk.com请求成功")
else:
print(str(r.status_code)+" 第一条www.eebbk.com请求失败")
self.assertEqual(r.status_code,200)
def suite():
logintestCase = unittest.TestSuite()
logintestCase.addTest(logintest1("testlogin"))
return logintestCase
if __name__ == "__main__":
unittest.main()