Refactor out some global space to allow for testable code
and handling error conditions before flask is completely initialized.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
import os
|
||||
from puppetboard import docker_settings
|
||||
from puppetboard import app
|
||||
import puppetboard.core
|
||||
|
||||
try:
|
||||
import future.utils
|
||||
@@ -100,12 +100,14 @@ def test_graph_facts_custom(cleanUpEnv):
|
||||
assert 'extra' in facts
|
||||
|
||||
|
||||
def test_bad_log_value(cleanUpEnv):
|
||||
def test_bad_log_value(cleanUpEnv, mocker):
|
||||
os.environ['LOGLEVEL'] = 'g'
|
||||
os.environ['PUPPETBOARD_SETTINGS'] = '../puppetboard/docker_settings.py'
|
||||
reload(docker_settings)
|
||||
|
||||
puppetboard.core.APP = None
|
||||
with pytest.raises(ValueError) as error:
|
||||
reload(app)
|
||||
puppetboard.core.get_app()
|
||||
|
||||
|
||||
def test_default_table_selctor(cleanUpEnv):
|
||||
|
||||
Reference in New Issue
Block a user