# Path: expremigen/patterns/ptween.py
# class Ptween(Pattern):
#     """
#     class to glue pyvectortween to expremigen
#     """
# 
#     def __init__(self, animation: Animation, birthframe=0, startframe=0, stopframe=0,
#                  deathframe=0, noiseframe=None):
#         super().__init__()
#         self.animation = animation
#         self.bf = birthframe
#         self.staf = startframe
#         self.stof = stopframe
#         self.df = deathframe
#         self.nf = noiseframe
#         self.current_frame = 0
# 
#     def __iter__(self):
#         for i in range(int(self.df)):
#             yield self.animation.make_frame(i, self.bf, self.staf, self.stof, self.df, self.nf)
# 
#     def __str__(self):
#         return "{0}(<anim>, {1}, {2}, {3}, {4}, {5})".format(self.__class__.__name__, self.bf,
#                                                              self.staf, self.stof, self.df, self.nf)


import unittest
from vectortween.NumberAnimation import NumberAnimation
from expremigen.patterns.ptween import Ptween




class TestPtween(unittest.TestCase):
    def test_normal(self):
        n = NumberAnimation(frm=60, to=90, tween=['linear'])
        a = [i for i in Ptween(n, 0, 0, 10, 10, None)]
        self.assertEqual(a, [60, 63, 66, 69, 72, 75, 78, 81, 84, 87])

    def test_repr(self):
        n = NumberAnimation(frm=60, to=90, tween=['linear'])

# Path: expremigen/patterns/ptween.py
# class Ptween(Pattern):
#     """
#     class to glue pyvectortween to expremigen
#     """
# 
#     def __init__(self, animation: Animation, birthframe=0, startframe=0, stopframe=0,
#                  deathframe=0, noiseframe=None):
#         super().__init__()
#         self.animation = animation
#         self.bf = birthframe
#         self.staf = startframe
#         self.stof = stopframe
#         self.df = deathframe
#         self.nf = noiseframe
#         self.current_frame = 0
# 
#     def __iter__(self):
#         for i in range(int(self.df)):
#             yield self.animation.make_frame(i, self.bf, self.staf, self.stof, self.df, self.nf)
# 
#     def __str__(self):
#         return "{0}(<anim>, {1}, {2}, {3}, {4}, {5})".format(self.__class__.__name__, self.bf,
#                                                              self.staf, self.stof, self.df, self.nf)


# Path: tests/testptween.py
import unittest
from vectortween.NumberAnimation import NumberAnimation
from expremigen.patterns.ptween import Ptween





class TestPtween(unittest.TestCase):
    def test_normal(self):
        n = NumberAnimation(frm=60, to=90, tween=['linear'])
        a = [i for i in Ptween(n, 0, 0, 10, 10, None)]
        self.assertEqual(a, [60, 63, 66, 69, 72, 75, 78, 81, 84, 87])

    def test_repr(self):
        n = NumberAnimation(frm=60, to=90, tween=['linear'])

        self.assertEqual("{0}".format(Ptween(n, 0, 0, 10, 10)), "Ptween(<anim>, 0, 0, 10, 10, None)")