コード例 #1
0
ファイル: test_api.py プロジェクト: vadv/temboard
 def test_05_login_ko(self):
     """
     [api] 05: POST /login : Bad username format must return 406 HTTP code
     """
     status = 0
     try:
         (status, res) = temboard_request(
             ENV['g_ssl_cert_file_path'],
             method = 'POST',
             url = 'https://%s:%s/login' % (cf.G_HOST, cf.G_PORT),
             headers = {"Content-type": "application/json"},
             data = {'username': rand_string(2), 'password': rand_string(12)})
     except HTTPError as e:
         status = e.code
     assert status == 406
コード例 #2
0
 def test_04_login_ko(self):
     """
     [api] 04: POST /login : Wrong username must return 404 HTTP code
     """
     status = 0
     try:
         (status, res) = temboard_request(
             ENV['agent']['ssl_cert_file'],
             method='POST',
             url='https://%s:%s/login' %
             (ENV['agent']['host'], ENV['agent']['port']),
             headers={"Content-type": "application/json"},
             data={
                 'username': rand_string(12),
                 'password': rand_string(12)
             })
     except HTTPError as e:
         status = e.code
     assert status == 404