コード例 #1
0
ファイル: tests.py プロジェクト: kevinteg/CyberQInterface
 def testInvalidReturnCode(self):
     """
     Test that the proper exception is thrown if the server returns bad
     status code
     """
     with patch.object(requests, 'get') as mockMethod:
         with self.assertRaises(ResponseHTTPException):
             cqi = CyberQInterface("127.0.0.1")
             mockMethod.return_value.status_code = 500
             cqi.getConfigXML()
コード例 #2
0
ファイル: tests.py プロジェクト: markterrill/CyberQInterface
 def testInvalidReturnCode(self):
     """
     Test that the proper exception is thrown if the server returns bad
     status code
     """
     with patch.object(requests, 'get') as mockMethod:
         with self.assertRaises(ResponseHTTPException):
             cqi = CyberQInterface("127.0.0.1")
             mockMethod.return_value.status_code = 500
             cqi.getConfigXML()