コード例 #1
0
ファイル: test_nginx.py プロジェクト: tsuru/rpaas
 def test_add_session_ticket_success(self, requests, os_path):
     nginx = Nginx({'CA_CERT': 'cert data'})
     os_path.exists.return_value = True
     response = mock.Mock()
     response.status_code = 200
     response.text = '\n\nticket was succsessfully added'
     requests.request.return_value = response
     nginx.add_session_ticket('host-1', 'random data', timeout=2)
     requests.request.assert_called_once_with('post', 'https://host-1:8090/session_ticket', timeout=2,
                                              data='random data', verify='/tmp/rpaas_ca.pem')
コード例 #2
0
ファイル: test_nginx.py プロジェクト: renatosis/rpaas
 def test_add_session_ticket_success(self, requests, os_path):
     nginx = Nginx({'CA_CERT': 'cert data'})
     os_path.exists.return_value = True
     response = mock.Mock()
     response.status_code = 200
     response.text = '\n\nticket was succsessfully added'
     requests.request.return_value = response
     nginx.add_session_ticket('host-1', 'random data', timeout=2)
     requests.request.assert_called_once_with(
         'post',
         'https://host-1:8090/session_ticket',
         timeout=2,
         data='random data',
         verify='/tmp/rpaas_ca.pem')
コード例 #3
0
ファイル: test_nginx.py プロジェクト: tsuru/rpaas
 def test_missing_ca_cert(self, requests):
     nginx = Nginx()
     with self.assertRaises(NginxError):
         nginx.add_session_ticket('host-1', 'random data', timeout=2)
コード例 #4
0
ファイル: test_nginx.py プロジェクト: renatosis/rpaas
 def test_missing_ca_cert(self, requests):
     nginx = Nginx()
     with self.assertRaises(NginxError):
         nginx.add_session_ticket('host-1', 'random data', timeout=2)