OP-3951 - use ext on representation

Without it ass.gz files won't work
This commit is contained in:
Petr Kalis 2023-03-27 16:55:19 +02:00
parent 179467751c
commit 93d98c3f9c
2 changed files with 23 additions and 5 deletions

View file

@ -33,7 +33,11 @@ class ValidateSequenceFrames(pyblish.api.InstancePlugin):
if isinstance(repr_files, str):
repr_files = [repr_files]
_, ext = os.path.splitext(repr_files[0])
ext = repr.get("ext")
if not ext:
_, ext = os.path.splitext(repr_files[0])
elif not ext.startswith("."):
ext = ".{}".format(ext)
pattern = r"\D?(?P<index>(?P<padding>0*)\d+){}$".format(
re.escape(ext))
patterns = [pattern]

View file

@ -99,13 +99,12 @@ class TestValidateSequenceFrames(BaseTest):
str(excinfo.value))
@pytest.mark.parametrize("files",
["Main_beauty.1001.v001.ass.gz"])
def test_validate_sequence_frames_single_frame_possible_wrong_name(self,
instance, plugin, files):
["Main_beauty.v001.1001.ass.gz"])
def test_validate_sequence_frames_single_frame_possible_wrong_name(
self, instance, plugin, files):
# currently pattern fails on extensions with dots
representations = [
{
"ext": "exr",
"files": files,
}
]
@ -116,6 +115,21 @@ class TestValidateSequenceFrames(BaseTest):
assert ("Must not have remainder" in
str(excinfo.value))
@pytest.mark.parametrize("files",
["Main_beauty.v001.1001.ass.gz"])
def test_validate_sequence_frames_single_frame_correct_ext(
self, instance, plugin, files):
# currently pattern fails on extensions with dots
representations = [
{
"ext": "ass.gz",
"files": files,
}
]
instance.data["representations"] = representations
plugin.process(instance)
def test_validate_sequence_frames_multi_frame(self, instance, plugin):
representations = [
{