Skip to content

Commit

Permalink
Fixing bug : Check item type when found folder sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
Guiral Michaël committed Nov 7, 2016
1 parent f58fb99 commit d1d308a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sequenceParser/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ std::vector<Item> browse(

if( ! filepathRespectsAllFilters( iter->path(), reFilters, filename, detectOptions ) )
continue;

// if at least one number detected
if( decomposeFilename( iter->path().filename().string(), tmpStringParts, tmpNumberParts, detectOptions ) )
{
Expand Down Expand Up @@ -154,7 +154,7 @@ std::vector<Item> browse(
// It's a sequence of directories, so it's not a sequence.
BOOST_FOREACH( Time t, s.getFramesIterable() )
{
output.push_back( Item( eTypeFolder, directory / s.getFilenameAt(t) ) );
output.push_back( Item( getTypeFromPath(directory / s.getFilenameAt(t)), directory / s.getFilenameAt(t) ) );
}
}
else
Expand Down
19 changes: 19 additions & 0 deletions test/pyTest/testStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def setUp():

# 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():
Expand Down Expand Up @@ -98,6 +99,24 @@ def testFolderStat():
#assert_equals(itemStat.realSize, itemStat.size) # 0L != -1L
assert_greater_equal(itemStat.sizeOnDisk, itemStat.size)

def testFolderLinkStat():
"""
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() == "foo.###.png":
assert_equals(item.getType(), seq.eTypeSequence)
elif item.getFilename() == "dir1":
assert_equals(item.getType(), seq.eTypeFolder)

def testSequenceStat():
"""
Expand Down

0 comments on commit d1d308a

Please sign in to comment.