-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Guiral Michaël
committed
Nov 7, 2016
1 parent
d1d308a
commit 505cb91
Showing
2 changed files
with
50 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import time | ||
import tempfile | ||
import os | ||
import shutil | ||
|
||
from pySequenceParser import sequenceParser as seq | ||
from . import createFile, createFolder, getSequencesFromPath | ||
|
||
from nose.tools import * | ||
|
||
root_path = '' | ||
|
||
def setUp(): | ||
global root_path | ||
root_path = tempfile.mkdtemp() | ||
|
||
# create files | ||
files_to_create = [ | ||
"plop.txt" | ||
] | ||
for f in files_to_create: | ||
createFile(root_path, f) | ||
|
||
# create folder | ||
createFolder(root_path, "dir1") | ||
|
||
# create sym link | ||
os.symlink(os.path.join(root_path, "plop.txt"), os.path.join(root_path, "plop_sym_link.txt")) | ||
os.symlink(os.path.join(root_path, "dir1"), os.path.join(root_path, "dir2")) | ||
|
||
def tearDown(): | ||
global root_path | ||
shutil.rmtree(root_path) | ||
|
||
def testLinkType(): | ||
""" | ||
Check stats of a synbolic link folder. | ||
- 2 hard links (. and ..) | ||
- sizes | ||
""" | ||
print("testFolderLinkStat:") | ||
print("===================") | ||
items = seq.browse(root_path) | ||
for item in items: | ||
if item.getFilename() in ("plop_sym_link.txt", "dir2"): | ||
assert_equals(item.getType(), seq.eTypeLink) | ||
elif item.getFilename() == "plop.txt": | ||
assert_equals(item.getType(), seq.eTypeFile) | ||
elif item.getFilename() == "dir1": | ||
assert_equals(item.getType(), seq.eTypeFolder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters