Skip to content
This repository was archived by the owner on Dec 17, 2023. It is now read-only.

Commit cd4a93b

Browse files
fix: correct broken ConversationModelEvaluation resource pattern (#509)
* fix!: correct broken ConversationModelEvaluation resource pattern PiperOrigin-RevId: 442646533 Source-Link: googleapis/googleapis@b62c562 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f5c157c68115847d78eb8412734cb82e7d5515b4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjVjMTU3YzY4MTE1ODQ3ZDc4ZWI4NDEyNzM0Y2I4MmU3ZDU1MTViNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent aa358bb commit cd4a93b

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

google/cloud/dialogflow_v2/services/conversation_models/client.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,20 @@ def parse_conversation_model_path(path: str) -> Dict[str, str]:
217217
def conversation_model_evaluation_path(
218218
project: str,
219219
conversation_model: str,
220+
evaluation: str,
220221
) -> str:
221222
"""Returns a fully-qualified conversation_model_evaluation string."""
222-
return "projects/{project}/conversationModels/{conversation_model}/evaluations/evaluation".format(
223+
return "projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}".format(
223224
project=project,
224225
conversation_model=conversation_model,
226+
evaluation=evaluation,
225227
)
226228

227229
@staticmethod
228230
def parse_conversation_model_evaluation_path(path: str) -> Dict[str, str]:
229231
"""Parses a conversation_model_evaluation path into its component segments."""
230232
m = re.match(
231-
r"^projects/(?P<project>.+?)/conversationModels/(?P<conversation_model>.+?)/evaluations/evaluation$",
233+
r"^projects/(?P<project>.+?)/conversationModels/(?P<conversation_model>.+?)/evaluations/(?P<evaluation>.+?)$",
232234
path,
233235
)
234236
return m.groupdict() if m else {}

tests/unit/gapic/dialogflow_v2/test_conversation_models.py

+25-22
Original file line numberDiff line numberDiff line change
@@ -3742,20 +3742,23 @@ def test_parse_conversation_model_path():
37423742
def test_conversation_model_evaluation_path():
37433743
project = "squid"
37443744
conversation_model = "clam"
3745-
expected = "projects/{project}/conversationModels/{conversation_model}/evaluations/evaluation".format(
3745+
evaluation = "whelk"
3746+
expected = "projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}".format(
37463747
project=project,
37473748
conversation_model=conversation_model,
3749+
evaluation=evaluation,
37483750
)
37493751
actual = ConversationModelsClient.conversation_model_evaluation_path(
3750-
project, conversation_model
3752+
project, conversation_model, evaluation
37513753
)
37523754
assert expected == actual
37533755

37543756

37553757
def test_parse_conversation_model_evaluation_path():
37563758
expected = {
3757-
"project": "whelk",
3758-
"conversation_model": "octopus",
3759+
"project": "octopus",
3760+
"conversation_model": "oyster",
3761+
"evaluation": "nudibranch",
37593762
}
37603763
path = ConversationModelsClient.conversation_model_evaluation_path(**expected)
37613764

@@ -3765,9 +3768,9 @@ def test_parse_conversation_model_evaluation_path():
37653768

37663769

37673770
def test_document_path():
3768-
project = "oyster"
3769-
knowledge_base = "nudibranch"
3770-
document = "cuttlefish"
3771+
project = "cuttlefish"
3772+
knowledge_base = "mussel"
3773+
document = "winkle"
37713774
expected = "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format(
37723775
project=project,
37733776
knowledge_base=knowledge_base,
@@ -3779,9 +3782,9 @@ def test_document_path():
37793782

37803783
def test_parse_document_path():
37813784
expected = {
3782-
"project": "mussel",
3783-
"knowledge_base": "winkle",
3784-
"document": "nautilus",
3785+
"project": "nautilus",
3786+
"knowledge_base": "scallop",
3787+
"document": "abalone",
37853788
}
37863789
path = ConversationModelsClient.document_path(**expected)
37873790

@@ -3791,7 +3794,7 @@ def test_parse_document_path():
37913794

37923795

37933796
def test_common_billing_account_path():
3794-
billing_account = "scallop"
3797+
billing_account = "squid"
37953798
expected = "billingAccounts/{billing_account}".format(
37963799
billing_account=billing_account,
37973800
)
@@ -3801,7 +3804,7 @@ def test_common_billing_account_path():
38013804

38023805
def test_parse_common_billing_account_path():
38033806
expected = {
3804-
"billing_account": "abalone",
3807+
"billing_account": "clam",
38053808
}
38063809
path = ConversationModelsClient.common_billing_account_path(**expected)
38073810

@@ -3811,7 +3814,7 @@ def test_parse_common_billing_account_path():
38113814

38123815

38133816
def test_common_folder_path():
3814-
folder = "squid"
3817+
folder = "whelk"
38153818
expected = "folders/{folder}".format(
38163819
folder=folder,
38173820
)
@@ -3821,7 +3824,7 @@ def test_common_folder_path():
38213824

38223825
def test_parse_common_folder_path():
38233826
expected = {
3824-
"folder": "clam",
3827+
"folder": "octopus",
38253828
}
38263829
path = ConversationModelsClient.common_folder_path(**expected)
38273830

@@ -3831,7 +3834,7 @@ def test_parse_common_folder_path():
38313834

38323835

38333836
def test_common_organization_path():
3834-
organization = "whelk"
3837+
organization = "oyster"
38353838
expected = "organizations/{organization}".format(
38363839
organization=organization,
38373840
)
@@ -3841,7 +3844,7 @@ def test_common_organization_path():
38413844

38423845
def test_parse_common_organization_path():
38433846
expected = {
3844-
"organization": "octopus",
3847+
"organization": "nudibranch",
38453848
}
38463849
path = ConversationModelsClient.common_organization_path(**expected)
38473850

@@ -3851,7 +3854,7 @@ def test_parse_common_organization_path():
38513854

38523855

38533856
def test_common_project_path():
3854-
project = "oyster"
3857+
project = "cuttlefish"
38553858
expected = "projects/{project}".format(
38563859
project=project,
38573860
)
@@ -3861,7 +3864,7 @@ def test_common_project_path():
38613864

38623865
def test_parse_common_project_path():
38633866
expected = {
3864-
"project": "nudibranch",
3867+
"project": "mussel",
38653868
}
38663869
path = ConversationModelsClient.common_project_path(**expected)
38673870

@@ -3871,8 +3874,8 @@ def test_parse_common_project_path():
38713874

38723875

38733876
def test_common_location_path():
3874-
project = "cuttlefish"
3875-
location = "mussel"
3877+
project = "winkle"
3878+
location = "nautilus"
38763879
expected = "projects/{project}/locations/{location}".format(
38773880
project=project,
38783881
location=location,
@@ -3883,8 +3886,8 @@ def test_common_location_path():
38833886

38843887
def test_parse_common_location_path():
38853888
expected = {
3886-
"project": "winkle",
3887-
"location": "nautilus",
3889+
"project": "scallop",
3890+
"location": "abalone",
38883891
}
38893892
path = ConversationModelsClient.common_location_path(**expected)
38903893

0 commit comments

Comments
 (0)