Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Case('$F', '@'),
Case('$F1', '@'),
Case('$F2', '@@'),
Case('$F4', '#'),
Case('', ''),
Case('foo', 'foo', error=True),
]
for case in tests:
if case.error:
with self.assertRaises(ValueError):
FileSequence.conformPadding(case.src)
continue
actual = FileSequence.conformPadding(case.src)
self.assertEqual(actual, case.expected)
self.assertNativeStr(actual)
Case('%00d', '@'),
Case('%1d', '@'),
Case('%d', '@'),
Case('$F', '@'),
Case('$F1', '@'),
Case('$F2', '@@'),
Case('$F4', '#'),
Case('', ''),
Case('foo', 'foo', error=True),
]
for case in tests:
if case.error:
with self.assertRaises(ValueError):
FileSequence.conformPadding(case.src)
continue
actual = FileSequence.conformPadding(case.src)
self.assertEqual(actual, case.expected)
self.assertNativeStr(actual)
def testNativeStr(self):
seq = FileSequence("/foo/boo.1-5#.exr")
self.assertNativeStr(seq.dirname())
self.assertNativeStr(seq.basename())
self.assertNativeStr(seq.padding())
self.assertNativeStr(seq.extension())
self.assertNativeStr(seq.extension())
self.assertNativeStr(seq.format('{basename}'))
self.assertNativeStr(seq.frame(1))
self.assertNativeStr(seq.frameRange())
self.assertNativeStr(seq.index(1))
self.assertNativeStr(seq.invertedFrameRange())
self.assertNativeStr(FileSequence.conformPadding('#'))
self.assertNativeStr(FileSequence.getPaddingChars(4))