Files
deb-python-dcos/tests/test_util.py
Cody Maloney 3f26840087 improve tox config: TeamCity test output, flake8-import-sort, pep8-naming (#780)
* Subprocess().Popen() -> Subprocess().popen() per PEP-8 conventions
* Move cosmos_error out of class because it isn't a member function per PEP-8
* Add pep8-naming plugin to flake8 so PEP-8 errors are caught during syntax checks
2016-10-05 11:58:02 -07:00

14 lines
349 B
Python

import pytest
from dcos import util
from dcos.errors import DCOSException
def test_open_file():
path = 'nonexistant_file_name.txt'
with pytest.raises(DCOSException) as excinfo:
with util.open_file(path):
pass
assert 'Error opening file [{}]: No such file or directory'.format(path) \
in str(excinfo.value)