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