Beispiel #1
0
    def get_publish_path(self, entity):
        if entity.get("type") == "Task":
            hierarchy = self.get_task_path(entity)
        elif entity.get("type") == "OutputFile":
            hierarchy = self.get_output_file_path(entity)

        path, _ = lucidity.format(hierarchy, self.templates)
        path = os.path.join(self.mount_point, path)
        return system_format(path)
Beispiel #2
0
    def get_work_path(self, entity):
        if entity.get("type") == "Task":
            hierarchy = self.get_task_path(entity)
        elif entity.get("type") == "OutputFile":
            hierarchy = self.get_output_file_path(entity)

        hierarchy["task_category"] = "WORK"
        hierarchy["shot_task"] = entity.get("task_type").get("name")

        path, _ = lucidity.format(hierarchy, self.templates)
        path = os.path.join(self.mount_point, path)
        return system_format(path)
Beispiel #3
0
def test_successfull_format(data, expected, templates):
    '''Format data successfully against multiple candidate templates.'''
    path, template = lucidity.format(data, templates)
    assert path == expected
Beispiel #4
0
def test_unsuccessfull_format(data, templates):
    '''Unsuccessful formatting of data against multiple candidate templates.'''
    with pytest.raises(lucidity.FormatError):
        lucidity.format(data, templates)
def test_successfull_format(data, expected, templates):
    '''Format data successfully against multiple candidate templates.'''
    path, template = lucidity.format(data, templates)
    assert path == expected
def test_unsuccessfull_format(data, templates):
    '''Unsuccessful formatting of data against multiple candidate templates.'''
    with pytest.raises(lucidity.FormatError):
        lucidity.format(data, templates)