|
|
|
@ -36,6 +36,8 @@ import threading |
|
|
|
|
import unittest |
|
|
|
|
from concurrent import futures |
|
|
|
|
|
|
|
|
|
import six |
|
|
|
|
|
|
|
|
|
# test_interfaces is referenced from specification in this module. |
|
|
|
|
from grpc.framework.foundation import logging_pool |
|
|
|
|
from grpc.framework.interfaces.face import face |
|
|
|
@ -141,7 +143,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testSuccessfulUnaryRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -156,7 +158,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testSuccessfulUnaryRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
|
|
|
|
@ -168,7 +170,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testSuccessfulStreamRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
request_iterator = _PauseableIterator(iter(requests)) |
|
|
|
@ -188,7 +190,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testSuccessfulStreamRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
request_iterator = _PauseableIterator(iter(requests)) |
|
|
|
@ -204,7 +206,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testSequentialInvocations(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
first_request = test_messages.request() |
|
|
|
|
second_request = test_messages.request() |
|
|
|
@ -223,7 +225,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testParallelInvocations(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
first_request = test_messages.request() |
|
|
|
|
second_request = test_messages.request() |
|
|
|
@ -239,7 +241,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
test_messages.verify(second_request, second_response, self) |
|
|
|
|
|
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = [] |
|
|
|
|
response_futures = [] |
|
|
|
@ -259,7 +261,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
def testWaitingForSomeButNotAllParallelInvocations(self): |
|
|
|
|
pool = logging_pool.pool(test_constants.PARALLELISM) |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = [] |
|
|
|
|
response_futures_to_indices = {} |
|
|
|
@ -281,7 +283,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testCancelledUnaryRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -298,7 +300,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testCancelledUnaryRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
|
|
|
|
@ -312,7 +314,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testCancelledStreamRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -329,7 +331,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testCancelledStreamRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
|
|
|
|
@ -343,7 +345,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testExpiredUnaryRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -360,7 +362,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testExpiredUnaryRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
|
|
|
|
@ -372,7 +374,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testExpiredStreamRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -389,7 +391,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testExpiredStreamRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
|
|
|
|
@ -401,7 +403,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testFailedUnaryRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -423,7 +425,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testFailedUnaryRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.unary_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.unary_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
request = test_messages.request() |
|
|
|
|
|
|
|
|
@ -438,7 +440,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testFailedStreamRequestUnaryResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_unary_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_unary_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
callback = _Callback() |
|
|
|
@ -460,7 +462,7 @@ class TestCase(test_coverage.Coverage, unittest.TestCase): |
|
|
|
|
|
|
|
|
|
def testFailedStreamRequestStreamResponse(self): |
|
|
|
|
for (group, method), test_messages_sequence in ( |
|
|
|
|
self._digest.stream_stream_messages_sequences.iteritems()): |
|
|
|
|
six.iteritems(self._digest.stream_stream_messages_sequences)): |
|
|
|
|
for test_messages in test_messages_sequence: |
|
|
|
|
requests = test_messages.requests() |
|
|
|
|
|
|
|
|
|