Ejemplo n.º 1
0
    def test_delete_requests(self):
        handler = HttpBaseHandler()
        # Mock the uri method, since the handler doesn't provide one
        handler.uri = Mock()
        handler.uri.return_value = '/'
        handler.delete()

        self.mock_requests.request.assert_called_once_with(url='/',
                method='delete',
                verify='/path/ssl/StartSSL_CA.pem',
                )
Ejemplo n.º 2
0
    def test_change_cert_file(self):
        handler = HttpBaseHandler()
        handler.cert_file = 'something'
        # Mock the uri method, since the handler doesn't provide one
        handler.uri = Mock()
        handler.uri.return_value = '/'
        handler.get()

        self.mock_requests.request.assert_called_once_with(url='/',
                method='get',
                verify='something',
                )
Ejemplo n.º 3
0
    def test_basic_auth(self):
        env.username = '******'
        env.password = '******'
        handler = HttpBaseHandler()
        # Mock the uri method, since the handler doesn't provide one
        handler.uri = Mock()
        handler.uri.return_value = '/'
        handler.get()

        self.mock_requests.request.assert_called_once_with(url='/',
                method='get',
                verify='/path/ssl/StartSSL_CA.pem',
                auth=self.auth_token
                )

        env.username = None
        env.password = None