Skip to content
Snippets Groups Projects
Commit 45900913 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix tests for Proxy

parent d7a5f3a3
No related branches found
No related tags found
No related merge requests found
__version__ = '2.9.4_a6'
__version__ = '2.9.4_a7'
......@@ -133,19 +133,25 @@ class Proxy(tp.Generic[T]):
return self
def __itruediv__(self, other) -> 'Proxy':
self.obj /= other
self.__obj /= other
return self
def __ifloordiv__(self, other) -> 'Proxy':
self.obj //= other
self.__obj //= other
return self
def __rshift__(self, other):
return self.__obj >> other
def __lshift__(self, other):
return self.__obj << other
def __ilshift__(self, other) -> 'Proxy':
self.obj <<= other
self.__obj <<= other
return self
def __irshift__(self, other) -> 'Proxy':
self.obj >>= other
self.__obj >>= other
return self
def __iter__(self) -> tp.Iterator:
......@@ -164,10 +170,10 @@ class Proxy(tp.Generic[T]):
return self.__obj == other
def __or__(self, other):
return self.__obj or other
return self.__obj | other
def __and__(self, other):
return self.__obj and other
return self.__obj & other
def __le__(self, other) -> bool:
return self.__obj <= other
......
......@@ -16,8 +16,7 @@ class TestProxy(unittest.TestCase):
self.assertEqual(a ** 2, 5.25*5.25)
self.assertEqual(-a, -5.25)
self.assertEqual(math.floor(a), 5)
self.assertEqual(math.round(a), 5)
self.assertEqual(math.ceil(a), 6)
self.assertEqual(round(a), 5)
self.assertEqual(math.trunc(a), 5)
a = Proxy(2)
self.assertEqual(a & 2, 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment