rename config in class in test_config

This commit is contained in:
Jotagê Sales 2019-03-05 14:36:54 -03:00
parent 734730640a
commit b534df242b

View File

@ -17,20 +17,20 @@ def temp_path():
yield Path(td, "file") yield Path(td, "file")
class Config: class ConfigTest:
not_for_config = 'should not be used' not_for_config = 'should not be used'
CONFIG_VALUE = 'should be used' CONFIG_VALUE = 'should be used'
def test_load_from_object(app): def test_load_from_object(app):
app.config.from_object(Config) app.config.from_object(ConfigTest)
assert "CONFIG_VALUE" in app.config assert "CONFIG_VALUE" in app.config
assert app.config.CONFIG_VALUE == "should be used" assert app.config.CONFIG_VALUE == "should be used"
assert "not_for_config" not in app.config assert "not_for_config" not in app.config
def test_load_from_object_string(app): def test_load_from_object_string(app):
app.config.from_object('test_config.Config') app.config.from_object('test_config.ConfigTest')
assert 'CONFIG_VALUE' in app.config assert 'CONFIG_VALUE' in app.config
assert app.config.CONFIG_VALUE == 'should be used' assert app.config.CONFIG_VALUE == 'should be used'
assert 'not_for_config' not in app.config assert 'not_for_config' not in app.config