示例#1
0
def test_related_dir_relative():
    fp = 'foo/bar/baz.pyn'
    rel = filer._related_dir(fp)
    normpath = os.path.normpath
    assert normpath(rel) == normpath('foo/bar/baz_pynd')
示例#2
0
def test_related_dir_not_pyn():
    fp = '/foo/bar/baz'
    rel = filer._related_dir(fp)
    normpath = os.path.normpath
    assert normpath(rel) == normpath('/foo/bar/baz_pynd')
示例#3
0
def test_writeable_not_savesingle_with_related_dir(tmpdir):
    fp = str(tmpdir.join('test_writeable.pyn'))
    reldir = filer._related_dir(fp)
    os.mkdir(reldir)
    assert filer.writeable(fp, False)
    os.rmdir(reldir)