コード例 #1
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_file_creation_nested(tmpdir):
    """Verify a file can be created in a new directory."""
    tmpdir.chdir()

    dirpath = os.path.join('path', 'to', 'directory')
    path = os.path.join(dirpath, 'file.ext')

    common.touch(path)
    assert os.path.isfile(path)
コード例 #2
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_file_creation_nested(tmpdir):
    """Verify a file can be created in a new directory."""
    tmpdir.chdir()

    dirpath = os.path.join('path', 'to', 'directory')
    path = os.path.join(dirpath, 'file.ext')

    common.touch(path)
    assert os.path.isfile(path)
コード例 #3
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_file_creation(tmpdir):
    """Verify a file can be created in an existing directory."""
    tmpdir.chdir()

    path = os.path.join('.', 'file.ext')

    common.touch(path)
    assert os.path.isfile(path)

    common.touch(path)  # second call is ignored
    assert os.path.isfile(path)
コード例 #4
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_file_creation(tmpdir):
    """Verify a file can be created in an existing directory."""
    tmpdir.chdir()

    path = os.path.join('.', 'file.ext')

    common.touch(path)
    assert os.path.isfile(path)

    common.touch(path)  # second call is ignored
    assert os.path.isfile(path)
コード例 #5
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_file_deletion(tmpdir):
    """Verify a file can be deleted."""
    tmpdir.chdir()

    path = os.path.join('.', 'file.ext')

    common.touch(path)
    assert os.path.isfile(path)

    common.delete(path)
    assert not os.path.isfile(path)

    common.delete(path)  # second call is ignored
    assert not os.path.isfile(path)
コード例 #6
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_file_deletion(tmpdir):
    """Verify a file can be deleted."""
    tmpdir.chdir()

    path = os.path.join('.', 'file.ext')

    common.touch(path)
    assert os.path.isfile(path)

    common.delete(path)
    assert not os.path.isfile(path)

    common.delete(path)  # second call is ignored
    assert not os.path.isfile(path)
コード例 #7
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_directory_deletion(tmpdir):
    """Verify a directory can be deleted."""
    tmpdir.chdir()

    dirpath = os.path.join('path', 'to', 'directory')
    path = os.path.join(dirpath, 'file.ext')

    common.touch(path)
    assert os.path.isdir(dirpath)

    common.delete(dirpath)
    assert not os.path.isdir(dirpath)

    common.delete(dirpath)  # second call is ignored
    assert not os.path.isdir(dirpath)
コード例 #8
0
ファイル: test_common.py プロジェクト: gitter-badger/yorm
def test_directory_deletion(tmpdir):
    """Verify a directory can be deleted."""
    tmpdir.chdir()

    dirpath = os.path.join('path', 'to', 'directory')
    path = os.path.join(dirpath, 'file.ext')

    common.touch(path)
    assert os.path.isdir(dirpath)

    common.delete(dirpath)
    assert not os.path.isdir(dirpath)

    common.delete(dirpath)  # second call is ignored
    assert not os.path.isdir(dirpath)