# Path: mugen/mixins/Persistable.py
# class Persistable:
#     """
#     Mixin for persisting objects
#     """
# 
#     @use_temporary_file_fallback("output_path", PICKLE_EXTENSION)
#     def save(self, output_path: Optional[str] = None):
#         with open(output_path, "wb") as output_file:
#             dill.dump(self, output_file)
# 
#         return output_path
# 
#     @classmethod
#     def load(cls, input_path: str):
#         with open(input_path, "rb") as input_file:
#             persistable = dill.load(input_file)
# 
#         return persistable


from mugen.mixins.Persistable import Persistable


class CoolClass(Persistable):
    def __init__(self, coolness: int = 1, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.coolness = coolness


def test_save_load():
    cool = CoolClass(5)
    cool_file = cool.save()

# Path: mugen/mixins/Persistable.py
# class Persistable:
#     """
#     Mixin for persisting objects
#     """
# 
#     @use_temporary_file_fallback("output_path", PICKLE_EXTENSION)
#     def save(self, output_path: Optional[str] = None):
#         with open(output_path, "wb") as output_file:
#             dill.dump(self, output_file)
# 
#         return output_path
# 
#     @classmethod
#     def load(cls, input_path: str):
#         with open(input_path, "rb") as input_file:
#             persistable = dill.load(input_file)
# 
#         return persistable


# Path: tests/integration/mixins/test_Persistable.py
from mugen.mixins.Persistable import Persistable



class CoolClass(Persistable):
    def __init__(self, coolness: int = 1, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.coolness = coolness


def test_save_load():
    cool = CoolClass(5)
    cool_file = cool.save()

    loaded_cool = CoolClass.load(cool_file)