Skip to content

Change the default return language to en-US #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tencentcloud/common/profile/client_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class ClientProfile(object):
unsignedPayload = False

def __init__(self, signMethod=None, httpProfile=None, language="zh-CN",
def __init__(self, signMethod=None, httpProfile=None, language="en-US",
disable_region_breaker=True, region_breaker_profile=None, request_client=None):
"""SDK profile.

Expand Down
27 changes: 27 additions & 0 deletions tests/integration/common/test_default_en_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
import os
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cvm.v20170312 import cvm_client, models


def test_default_en_profile():
try:
cred = credential.Credential(
os.environ.get("TENCENTCLOUD_SECRET_ID"),
os.environ.get("TENCENTCLOUD_SECRET_KEY"))
httpProfile = HttpProfile()
httpProfile.endpoint = "cvm.tencentcloudapi.com"

clientProfile = ClientProfile()
clientProfile.httpProfile = httpProfile
client = cvm_client.CvmClient(cred, "ap-guangzhou", clientProfile)

req = models.DescribeZonesRequest()
resp = client.DescribeZones(req)
if resp.TotalCount > 0:
assert "Guangzhou" in resp.to_json_string(), "default \"language=en-US\" not working"
except TencentCloudSDKException as err:
assert False, "unexpected request failure"
4 changes: 2 additions & 2 deletions tests/integration/common/test_request_common_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def test_request_common_param_language():
endpoint = "cvm.tencentcloudapi.com"
region = "ap-guangzhou"
language = "en-US"
language = "zh-CN"

try:
cred = credential.Credential(
Expand All @@ -27,6 +27,6 @@ def test_request_common_param_language():
req = models.DescribeZonesRequest()
resp = client.DescribeZones(req)
if resp.TotalCount > 0:
assert "Guangzhou" in resp.to_json_string(), "language=en-US not working"
assert "Guangzhou" not in resp.to_json_string(), "language=zh-CN not working"
except TencentCloudSDKException as err:
assert False, "unexpected request failure"