Esempio n. 1
0
 def parse_request(self, parse_params: HttpRequest) -> dict:
     return recursive_json_join(
         {
             "info": {
                 "resourceName":
                 safe_key_from_json(parse_params.body, "StreamName")
             }
         },
         super().parse_request(parse_params),
     )
Esempio n. 2
0
 def _extract_message_id(response_body: bytes) -> Optional[str]:
     return safe_key_from_json(
         response_body, "SequenceNumber") or safe_get(  # type: ignore
             safe_key_from_json(response_body, "Records", []),
             [0, "SequenceNumber"]  # type: ignore
         )
Esempio n. 3
0
def test_key_from_json(input_params, expected_output):
    assert safe_key_from_json(*input_params) == expected_output