Skip to content

Commit

Permalink
pyTest: added a test to check Sequence::isIn method
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement Champetier committed Aug 1, 2016
1 parent 41ddc44 commit 7176cb8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/pyTest/testStringSequenceDetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,27 @@ def testSingleSequence():
assert_equals(len(listSequence), 1)


@with_setup(setUpSingleSequence, tearDownOneTest)
def testFilenameInSequence():
"""
Check sequence detection with one sequence.
"""
global path_bbb
listSequence = getSequencesFromPath(path_bbb, seq.eDetectionDefault)
sequence = listSequence[0].getSequence()

# check filenames which are not in the sequence
assert_equals(sequence.isIn(""), [False, 0, '']) # empty filename
assert_equals(sequence.isIn("toto"), [False, 0, '']) # completly different filename
assert_equals(sequence.isIn("a1c2.j2c"), [False, 0, '']) # different prefix
assert_equals(sequence.isIn("a1b2.jpg"), [False, 0, '']) # different suffix
assert_equals(sequence.isIn("a1b10.j2c"), [False, 0, '']) # not an existing time

# check a filename which is in the sequence
isIn = sequence.isIn("a1b2.j2c")
assert_equals(isIn, [True, 2, '2'])


def setUpSingleSequenceMultiRanges():
global path_bbb
path_bbb = tempfile.mkdtemp('bbb', dir=root_aaa)
Expand Down

0 comments on commit 7176cb8

Please sign in to comment.