def test_exists_file(tmpdir): """ Check that exists_file returns True for a temp file. The temp file is deleted after this test finishes. """ existent = tmpdir.mkdir('test_file').join('dummy.txt') existent.write('hello world!') path = str(existent) assert utils.exists_file(path) assert not utils.exists_dir(path)
def test_not_exists_dir(): """ Check that exists_dir returns False for nonexistent path """ nonexistent = '~/blahblah/' assert not utils.exists_dir(nonexistent)
def test_exists_tmpdir(tmpdir): """ Check that exists_dir returns True on a temporary directory. """ path = tmpdir.mkdir('test_exists') assert utils.exists_dir(str(path))
def test_exists_dir(): """ Check that exists_dir returns True for root directory. """ existent = '/' assert utils.exists_dir(existent)