|
|
@ -161,8 +161,8 @@ class TransmissionTest(object): |
|
|
|
raise NotImplementedError() |
|
|
|
raise NotImplementedError() |
|
|
|
|
|
|
|
|
|
|
|
@abc.abstractmethod |
|
|
|
@abc.abstractmethod |
|
|
|
def assertMetadataEqual(self, original_metadata, transmitted_metadata): |
|
|
|
def assertMetadataTransmitted(self, original_metadata, transmitted_metadata): |
|
|
|
"""Asserts that two metadata objects are equal. |
|
|
|
"""Asserts that transmitted_metadata contains original_metadata. |
|
|
|
|
|
|
|
|
|
|
|
Args: |
|
|
|
Args: |
|
|
|
original_metadata: A metadata object used in this test. |
|
|
|
original_metadata: A metadata object used in this test. |
|
|
@ -170,7 +170,8 @@ class TransmissionTest(object): |
|
|
|
through the system under test. |
|
|
|
through the system under test. |
|
|
|
|
|
|
|
|
|
|
|
Raises: |
|
|
|
Raises: |
|
|
|
AssertionError: if the two metadata objects are not equal. |
|
|
|
AssertionError: if the transmitted_metadata object does not contain |
|
|
|
|
|
|
|
original_metadata. |
|
|
|
""" |
|
|
|
""" |
|
|
|
raise NotImplementedError() |
|
|
|
raise NotImplementedError() |
|
|
|
|
|
|
|
|
|
|
@ -239,7 +240,7 @@ class TransmissionTest(object): |
|
|
|
self.assertFalse(initial_metadata_seen) |
|
|
|
self.assertFalse(initial_metadata_seen) |
|
|
|
self.assertFalse(seen_payloads) |
|
|
|
self.assertFalse(seen_payloads) |
|
|
|
self.assertFalse(terminal_metadata_seen) |
|
|
|
self.assertFalse(terminal_metadata_seen) |
|
|
|
self.assertMetadataEqual(initial_metadata, ticket.initial_metadata) |
|
|
|
self.assertMetadataTransmitted(initial_metadata, ticket.initial_metadata) |
|
|
|
initial_metadata_seen = True |
|
|
|
initial_metadata_seen = True |
|
|
|
|
|
|
|
|
|
|
|
if ticket.payload is not None: |
|
|
|
if ticket.payload is not None: |
|
|
@ -248,7 +249,7 @@ class TransmissionTest(object): |
|
|
|
|
|
|
|
|
|
|
|
if ticket.terminal_metadata is not None: |
|
|
|
if ticket.terminal_metadata is not None: |
|
|
|
self.assertFalse(terminal_metadata_seen) |
|
|
|
self.assertFalse(terminal_metadata_seen) |
|
|
|
self.assertMetadataEqual(terminal_metadata, ticket.terminal_metadata) |
|
|
|
self.assertMetadataTransmitted(terminal_metadata, ticket.terminal_metadata) |
|
|
|
terminal_metadata_seen = True |
|
|
|
terminal_metadata_seen = True |
|
|
|
self.assertSequenceEqual(payloads, seen_payloads) |
|
|
|
self.assertSequenceEqual(payloads, seen_payloads) |
|
|
|
|
|
|
|
|
|
|
|