def test_get_request_id_no_id(self): """Ensures None is returned if metadata does't contain a request ID.""" mock_metadata = (('another-key', 'another-val'), ) result = (Interceptor.get_request_id_from_metadata(mock_metadata)) self.assertEqual(result, None)
def test_get_request_id_from_metadata(self): """Ensures request-id is retrieved from metadata tuple.""" mock_metadata = (('request-id', '123456'), ) result = Interceptor.get_request_id_from_metadata(mock_metadata) self.assertEqual(result, '123456')