def test_encode_request_data(): data, _ = encode_request_data('foo', None) assert data == 'foo' data, f = encode_request_data(None, 'json') assert data == '{}' assert f == 'application/json' data, f = encode_request_data(None, 'urlencoded') assert data == '' assert f == 'application/x-www-form-urlencoded'