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)
示例#2
0
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)
示例#4
0
def test_not_exists_file():
    """
    Check that exists_file returns False for nonexistent file
    """
    nonexistent = '~/blabjfajdfd'
    assert not utils.exists_file(nonexistent)