* 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
14 lines
349 B
Python
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)
|