Beispiel #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
Beispiel #2
0
def test_fileTouch():
    """It creates the empty file and exits True."""
    FT.fileTouch(testfile)
    assert FT.fileExists(testfile) is True
Beispiel #3
0
def test_fileExists_exception():
    """It raises a TypeError Exception."""
    with pytest.raises(TypeError):
        FT.fileExists([])
Beispiel #4
0
def test_fileExists_nonexist():
    """It exits False."""
    got = FT.fileExists("/non-existant")
    assert got is False
Beispiel #5
0
def test_fileDelete():
    """It deletes the test file and exits False."""
    FT.fileDelete(renamefile)
    assert FT.fileExists(renamefile) is False
Beispiel #6
0
def test_fileExists():
    """It exits True."""
    got = FT.fileExists(__file__)
    assert got is True
Beispiel #7
0
def test_rename():
    """It renames the test file and exits True."""
    FT.rename(testfile, renamefile)
    assert FT.fileExists(renamefile) is True
Beispiel #8
0
def test_fileTouch_exist():
    """It creates the empty file and exits True."""
    FT.fileTouch(testfile, truncate=False)
    assert FT.fileExists(testfile) is True