Пример #1
0
 def test_div(self):
     for i in range(10):
         res = i//3
         f1 = iobj.W_IntObject(i)
         f2 = iobj.W_IntObject(3)
         result = iobj.div__Int_Int(self.space, f1, f2)
         assert result.intval == res
     x = -sys.maxint-1
     y = -1
     f1 = iobj.W_IntObject(x)
     f2 = iobj.W_IntObject(y)
     assert self.space.w_OverflowError == (
                       self._unwrap_nonimpl(iobj.div__Int_Int, self.space, f1, f2))
Пример #2
0
 def test_div(self):
     for i in range(10):
         res = i // 3
         f1 = iobj.W_IntObject(i)
         f2 = iobj.W_IntObject(3)
         result = iobj.div__Int_Int(self.space, f1, f2)
         assert result.intval == res
     x = -sys.maxint - 1
     y = -1
     f1 = iobj.W_IntObject(x)
     f2 = iobj.W_IntObject(y)
     assert self.space.w_OverflowError == (self._unwrap_nonimpl(
         iobj.div__Int_Int, self.space, f1, f2))