Remove 204-NoContent, Flask, and Werkzeug no longer provide

public apis to add additional error code exception handling.
This commit is contained in:
Mike Terzo
2017-03-20 19:02:00 -04:00
parent 796e2ee7fd
commit cdedf94506
3 changed files with 0 additions and 41 deletions

View File

@@ -12,7 +12,6 @@ from werkzeug.exceptions import NotFound, InternalServerError
from puppetboard import utils
from puppetboard import app
from puppetboard.app import NoContent
from bs4 import BeautifulSoup
import logging
@@ -108,19 +107,6 @@ def test_http_connection_error(mock_log):
mock_log.error.assert_called_with(err)
def test_http_empty(mock_log, mocker):
err = "Empty Response"
def connection_error():
raise EmptyResponseError(err)
flask_abort = mocker.patch('flask.abort')
with pytest.raises(NoContent):
utils.get_or_abort(connection_error)
mock_log.error.assert_called_with(err)
flask_abort.assert_called_with('204')
def test_db_version_good(mocker, mock_info_log):
mocker.patch.object(app.puppetdb, 'current_version', return_value='4.2.0')
err = 'PuppetDB Version %d.%d.%d' % (4, 2, 0)