Exemplo n.º 1
0
def test_cleanup():
    """It cleans up the test files and exits False."""
    FT.fileDelete(testfile)
    FT.fileDelete(renamefile)
    if FT.dirExists(ptestpath):
        os.rmdir(ptestpath)
    assert FT.fileExists(testfile) is False and FT.fileExists(renamefile) is False
Exemplo n.º 2
0
def test_makeFilePath():
    """It creates the directory structure for the testfile."""
    FT.makeFilePath(testfile)
    assert FT.dirExists(os.environ.get("HOME")) is True
Exemplo n.º 3
0
def test_makePath():
    """It creates the ptestpath path."""
    if FT.dirExists(ptestpath):
        os.rmdir(ptestpath)
    FT.makePath(ptestpath)
    assert FT.dirExists(ptestpath) is True
Exemplo n.º 4
0
def test_dirExists_exception():
    """It raises a TypeError Exception."""
    with pytest.raises(TypeError):
        FT.dirExists([])
Exemplo n.º 5
0
def test_dirExists():
    """It exits True."""
    dird = os.path.dirname(__file__)
    got = FT.dirExists(dird)
    assert got is True