Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_config_dir_not_found():
with pytest.raises(IOError) as excinfo:
vaping.daemon.Vaping(config_dir="does/not/exist")
assert 'config dir not found' in str(excinfo.value)
def test_load_config_files(data_config_daemon):
codec = munge.get_codec('yaml')()
data = codec.loads(data_config_daemon.yml)
data['vaping'] = dict(home_dir=os.path.realpath(data_config_daemon.path))
daemon = vaping.daemon.Vaping(config=data)
# print(data_config_daemon.dumps(daemon.config.data))
data_config_daemon.expected["vaping"]["home_dir"] = os.path.realpath(data_config_daemon.expected["vaping"]["home_dir"])
assert data_config_daemon.expected == daemon.config.data