# Path: testsuite/cases/base.py
# def rpartial(func, *args, **keywords):
#     """
#     right partial — same as functools.partial, but pass function args first
#     """
#     def newfunc(*fargs, **fkeywords):
#         newkeywords = keywords.copy()
#         newkeywords.update(fkeywords)
#         return func(*(fargs + args), **newkeywords)
#     newfunc.func = func
#     newfunc.args = args
#     newfunc.keywords = keywords
#     return newfunc
# 
# def root(*chunks):
#     return os.path.abspath(os.path.join(
#         os.path.dirname(__file__), '..', *chunks))
# 
# Path: testsuite/cases/wand.py
# class WandTestCase(BaseTestCase):
#     def __init__(self, *args, **kwargs):
#     def create_test_data(self):
#     def __del__(self):
#     def blur(self, radius, sigma):
#     def hald_lut(self, hald_image):


from .base import rpartial, root
from .wand import WandTestCase, Image


class LutCase(WandTestCase):
    def handle_args(self, table_size, hald_image):
        self.table_size = table_size
        self.hald_image = Image(filename=hald_image)
        self._free_resources.append(self.hald_image)

    def runner(self, im):
        with im.clone() as im:
            self.hald_lut(im, self.hald_image)

    def readable_args(self):
        return ["{}³ table to 3D".format(self.table_size)]


cases = [

# Path: testsuite/cases/base.py
# def rpartial(func, *args, **keywords):
#     """
#     right partial — same as functools.partial, but pass function args first
#     """
#     def newfunc(*fargs, **fkeywords):
#         newkeywords = keywords.copy()
#         newkeywords.update(fkeywords)
#         return func(*(fargs + args), **newkeywords)
#     newfunc.func = func
#     newfunc.args = args
#     newfunc.keywords = keywords
#     return newfunc
# 
# def root(*chunks):
#     return os.path.abspath(os.path.join(
#         os.path.dirname(__file__), '..', *chunks))
# 
# Path: testsuite/cases/wand.py
# class WandTestCase(BaseTestCase):
#     def __init__(self, *args, **kwargs):
#     def create_test_data(self):
#     def __del__(self):
#     def blur(self, radius, sigma):
#     def hald_lut(self, hald_image):


# Path: testsuite/cases/wand_lut.py
from .base import rpartial, root
from .wand import WandTestCase, Image



class LutCase(WandTestCase):
    def handle_args(self, table_size, hald_image):
        self.table_size = table_size
        self.hald_image = Image(filename=hald_image)
        self._free_resources.append(self.hald_image)

    def runner(self, im):
        with im.clone() as im:
            self.hald_lut(im, self.hald_image)

    def readable_args(self):
        return ["{}³ table to 3D".format(self.table_size)]


cases = [

    rpartial(LutCase, 4, root("resources", "hald.2.png")),