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_file(): """ Check that exists_file returns False for nonexistent file """ nonexistent = '~/blabjfajdfd' assert not utils.exists_file(nonexistent)