# Path: flexlay/math/point.py
# class Point:
# 
#     @staticmethod
#     def from_qt(qpoint):
#         return Point(qpoint.x(), qpoint.y())
# 
#     def __init__(self, arg1=None, arg2=None):
#         if arg1 is None and arg2 is None:
#             self.x = 0
#             self.y = 0
#         elif arg2 is None:
#             self.x = arg1.x
#             self.y = arg1.y
#         else:
#             self.x = arg1
#             self.y = arg2
# 
#     def copy(self):
#         return Point(self.x, self.y)
# 
#     def __add__(self, rhs):
#         return Point(self.x + rhs.x, self.y + rhs.y)
# 
#     def __sub__(self, rhs):
#         return Point(self.x - rhs.x, self.y - rhs.y)
# 
#     def __mul__(self, rhs):
#         return Point(self.x * rhs, self.y * rhs)
# 
#     def __rmul__(self, rhs):
#         return Point(self.x * rhs, self.y * rhs)
# 
#     def __eq__(self, rhs):
#         return self.x == rhs.x and self.y == rhs.y
# 
#     def __ne__(self, rhs):
#         return not self.__eq__(rhs)
# 
#     def to_qt(self):
#         return QPoint(self.x, self.y)
# 
#     def __str__(self):
#         return "Point({}, {})".format(self.x, self.y)


import unittest
from flexlay.math import Point
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.





class FlexlayMathTestCase(unittest.TestCase):

    def test_point(self):
        p = Point(11, 17)
        self.assertEqual(p.x, 11)
        self.assertEqual(p.y, 17)

        p = 3 * p
        p = p * 4
        p *= 5
        self.assertEqual(p.x, 660)
        self.assertEqual(p.y, 1020)


# Path: flexlay/math/point.py
# class Point:
# 
#     @staticmethod
#     def from_qt(qpoint):
#         return Point(qpoint.x(), qpoint.y())
# 
#     def __init__(self, arg1=None, arg2=None):
#         if arg1 is None and arg2 is None:
#             self.x = 0
#             self.y = 0
#         elif arg2 is None:
#             self.x = arg1.x
#             self.y = arg1.y
#         else:
#             self.x = arg1
#             self.y = arg2
# 
#     def copy(self):
#         return Point(self.x, self.y)
# 
#     def __add__(self, rhs):
#         return Point(self.x + rhs.x, self.y + rhs.y)
# 
#     def __sub__(self, rhs):
#         return Point(self.x - rhs.x, self.y - rhs.y)
# 
#     def __mul__(self, rhs):
#         return Point(self.x * rhs, self.y * rhs)
# 
#     def __rmul__(self, rhs):
#         return Point(self.x * rhs, self.y * rhs)
# 
#     def __eq__(self, rhs):
#         return self.x == rhs.x and self.y == rhs.y
# 
#     def __ne__(self, rhs):
#         return not self.__eq__(rhs)
# 
#     def to_qt(self):
#         return QPoint(self.x, self.y)
# 
#     def __str__(self):
#         return "Point({}, {})".format(self.x, self.y)


# Path: tests/test_math.py
import unittest
from flexlay.math import Point

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.





class FlexlayMathTestCase(unittest.TestCase):

    def test_point(self):
        p = Point(11, 17)
        self.assertEqual(p.x, 11)
        self.assertEqual(p.y, 17)

        p = 3 * p
        p = p * 4
        p *= 5
        self.assertEqual(p.x, 660)
        self.assertEqual(p.y, 1020)


        p = Point(0, 3) + p