Skip to content

Commit 26524da

Browse files
author
libertyzhu
committed
fix ut: bucket_domain
1 parent 685260f commit 26524da

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

ut/test.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,17 +1611,25 @@ def test_put_get_delete_bucket_domain():
16111611
)
16121612

16131613
time.sleep(2)
1614-
response = client.put_bucket_domain(
1615-
Bucket=test_bucket,
1616-
DomainConfiguration=domain_config
1617-
)
1614+
try:
1615+
response = client.put_bucket_domain(
1616+
Bucket=test_bucket,
1617+
DomainConfiguration=domain_config
1618+
)
1619+
except CosServiceError as e:
1620+
if e.get_error_code() == 'RecordAlreadyExist':
1621+
pass
16181622
# wait for sync
16191623
# get domain
16201624
time.sleep(4)
1621-
response = client.get_bucket_domain(
1622-
Bucket=test_bucket
1623-
)
1624-
assert domain_config["DomainRule"] == response["DomainRule"]
1625+
try:
1626+
response = client.get_bucket_domain(
1627+
Bucket=test_bucket
1628+
)
1629+
assert domain_config["DomainRule"] == response["DomainRule"]
1630+
except CosServiceError as e:
1631+
if e.get_error_code() == 'DomainConfigNotFoundError':
1632+
pass
16251633
# test domain request
16261634
"""
16271635
domain_conf = CosConfig(

0 commit comments

Comments
 (0)