How to use the uplink.arguments.Query function in uplink

To help you get started, we’ve selected a few uplink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_modify_request_with_mismatched_encoding(self, request_builder):
        arguments.Query("name", encoded=True).modify_request(
            request_builder, "value"
        )
        with pytest.raises(arguments.Query.QueryStringEncodingError):
            arguments.Query("name2", encoded=False).modify_request(
                request_builder, "value2"
            )
github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_skip_none(self, request_builder):
        arguments.Query("name").modify_request(request_builder, None)
        assert request_builder.info["params"] == {}
github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_modify_request_with_mismatched_encoding(self, request_builder):
        arguments.Query("name", encoded=True).modify_request(
            request_builder, "value"
        )
        with pytest.raises(arguments.Query.QueryStringEncodingError):
            arguments.Query("name2", encoded=False).modify_request(
                request_builder, "value2"
            )
github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_modify_request_with_encoded(self, request_builder):
        arguments.Query("name", encoded=True).modify_request(
            request_builder, "value"
        )
        assert request_builder.info["params"] == "name=value"
github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_modify_request(self, request_builder):
        arguments.Query("name").modify_request(request_builder, "value")
        assert request_builder.info["params"] == {"name": "value"}
github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_converter_key_with_encoded(self):
        query = arguments.Query("name", encoded=True)
        assert query.converter_key == keys.CONVERT_TO_STRING
github prkumar / uplink / tests / unit / test_arguments.py View on Github external
def test_converter_type(self):
        query = arguments.Query("name", encoded=False)
        assert query.converter_key == keys.Sequence(keys.CONVERT_TO_STRING)
github prkumar / uplink / uplink / arguments.py View on Github external
def update_params(info, new_params, encoded):
        existing = info.setdefault("params", None if encoded else dict())
        if encoded == isinstance(existing, collections.Mapping):
            raise Query.QueryStringEncodingError()
        Query._update_params(info, existing, new_params, encoded)
github prkumar / uplink / uplink / arguments.py View on Github external
def _modify_request(self, request_builder, value):
        """Updates request body with the mapping of query args."""
        Query.update_params(request_builder.info, value, self._encoded)