aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/tests/unit/framework/interfaces/base/_control.py
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-03-28 08:29:05 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-03-28 08:29:05 -0700
commit9d77ed5e2df5eabed41e0acac511d2f2edff3aad (patch)
tree51355e20b28e7515cc90922e2e3f3e0399992f9a /src/python/grpcio/tests/unit/framework/interfaces/base/_control.py
parentef37d7cd4eee37689380e727a268fbb06f286fcb (diff)
parent94f908ae84ab6d280a41e09245925ecfa612dce8 (diff)
Merge github.com:grpc/grpc into accounting
Diffstat (limited to 'src/python/grpcio/tests/unit/framework/interfaces/base/_control.py')
-rw-r--r--src/python/grpcio/tests/unit/framework/interfaces/base/_control.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/python/grpcio/tests/unit/framework/interfaces/base/_control.py b/src/python/grpcio/tests/unit/framework/interfaces/base/_control.py
index fe69e63995..94bcc1428e 100644
--- a/src/python/grpcio/tests/unit/framework/interfaces/base/_control.py
+++ b/src/python/grpcio/tests/unit/framework/interfaces/base/_control.py
@@ -29,6 +29,8 @@
"""Part of the tests of the base interface of RPC Framework."""
+from __future__ import division
+
import abc
import collections
import enum
@@ -47,8 +49,8 @@ from tests.unit.framework.interfaces.base import test_interfaces # pylint: disa
_GROUP = 'base test cases test group'
_METHOD = 'base test cases test method'
-_PAYLOAD_RANDOM_SECTION_MAXIMUM_SIZE = test_constants.PAYLOAD_SIZE / 20
-_MINIMUM_PAYLOAD_SIZE = test_constants.PAYLOAD_SIZE / 600
+_PAYLOAD_RANDOM_SECTION_MAXIMUM_SIZE = test_constants.PAYLOAD_SIZE // 20
+_MINIMUM_PAYLOAD_SIZE = test_constants.PAYLOAD_SIZE // 600
def _create_payload(randomness):
@@ -59,7 +61,7 @@ def _create_payload(randomness):
random_section = bytes(
bytearray(
randomness.getrandbits(8) for _ in range(random_section_length)))
- sevens_section = '\x07' * (length - random_section_length)
+ sevens_section = b'\x07' * (length - random_section_length)
return b''.join(randomness.sample((random_section, sevens_section), 2))
@@ -385,13 +387,13 @@ class _SequenceController(Controller):
return request + request
def deserialize_request(self, serialized_request):
- return serialized_request[:len(serialized_request) / 2]
+ return serialized_request[:len(serialized_request) // 2]
def serialize_response(self, response):
return response * 3
def deserialize_response(self, serialized_response):
- return serialized_response[2 * len(serialized_response) / 3:]
+ return serialized_response[2 * len(serialized_response) // 3:]
def invocation(self):
with self._condition: