fixing pluralization of api endpoints in tests
Change-Id: I0499a551c81fd72bf4c1fea1676fbf2e17159608
diff --git a/src/test/cord-api/Tests/targets/xosapitests.xtarget b/src/test/cord-api/Tests/targets/xosapitests.xtarget
index 53a58ce..7342cf0 100644
--- a/src/test/cord-api/Tests/targets/xosapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosapitests.xtarget
@@ -19,33 +19,19 @@
*** Test Cases *** TYPE API
{%- for m in proto.messages -%}
{%- if m.name not in ['XOSBase'] -%}
-{%- if m.name not in ['ServiceMonitoringAgentInfo', 'XOS'] -%}
{% autoescape false %}
{% endautoescape %}
-Create {{ m.name }} CREATE /xosapi/v1/${xos_service}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_1}
+Create {{ m.name }} CREATE /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}} ${json_{{ m.name | lower}}_1}
[Tags] {{ m.name }}
-Update {{ m.name }} UPDATE /xosapi/v1/${xos_service}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_updated_1} ${id}
+Update {{ m.name }} UPDATE /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}} ${json_{{ m.name | lower}}_updated_1} ${id}
[Tags] {{ m.name }}
-Get {{ m.name }} RETRIEVE /xosapi/v1/${xos_service}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
+Get {{ m.name }} RETRIEVE /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}} ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
[Tags] {{ m.name }}
-Delete {{ m.name }} DELETE /xosapi/v1/${xos_service}/{{ m.name | lower}}s data_id=${id}
+Delete {{ m.name }} DELETE /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}} data_id=${id}
[Tags] {{ m.name }}
-{% else %}
-Create {{ m.name }} CREATE /xosapi/v1/${xos_service}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_1}
- [Tags] {{ m.name }}
-
-Update {{ m.name }} UPDATE /xosapi/v1/${xos_service}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_updated_1} ${id}
- [Tags] {{ m.name }}
-
-Get {{ m.name }} RETRIEVE /xosapi/v1/${xos_service}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
- [Tags] {{ m.name }}
-
-Delete {{ m.name }} DELETE /xosapi/v1/${xos_service}/{{ m.name | lower}}es data_id=${id}
- [Tags] {{ m.name }}
-{% endif %}
{% endif %}
{% endfor -%}
@@ -213,4 +199,4 @@
\ Run Keyword And Ignore Error CORD Delete /xosapi/v1/${xos_service}/${dependent_{{ m.name | lower }}_ids[0]} ${dependent_{{ m.name | lower }}_ids[${INDEX}]}
{% endif %}
{% endfor -%}
- Delete All Sessions
\ No newline at end of file
+ Delete All Sessions
diff --git a/src/test/cord-api/Tests/targets/xoslibrary.xtarget b/src/test/cord-api/Tests/targets/xoslibrary.xtarget
index fb98677..bf98f32 100644
--- a/src/test/cord-api/Tests/targets/xoslibrary.xtarget
+++ b/src/test/cord-api/Tests/targets/xoslibrary.xtarget
@@ -144,7 +144,7 @@
${json_{{ m.name | lower}}_tmp}= Set Json Value ${json_{{ m.name | lower }}_tmp} /permit_all_slices true
{% endif -%}
${json_{{ m.name | lower }}_tmp}= To JSON ${json_{{ m.name | lower }}_tmp}
- ${resp}= CORD Post /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower }}_tmp}
+ ${resp}= CORD Post /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}} ${json_{{ m.name | lower }}_tmp}
${id_{{ m.name | lower }}_tmp}= Get Json Value ${resp.content} /id
Append To List ${dependent_{{ m.name | lower }}_ids} ${id_{{ m.name | lower }}_tmp}
[Return] ${id_{{ m.name | lower }}_tmp}
diff --git a/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget b/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
index 551f179..8b53c24 100644
--- a/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
@@ -22,33 +22,19 @@
{% for m in proto.messages %}
{%- if xproto_unquote(m.options.app_label) != "core" -%}
{%- if m.name not in ['XOSBase'] -%}
-{%- if m.name not in ['ServiceMonitoringAgentInfo', 'XOS'] -%}
{% autoescape false %}
{% endautoescape %}
-Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_1}
+Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1}
[Tags] {{ m.name }}
-Update {{ m.name }} UPDATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_updated_1} ${id}
+Update {{ m.name }} UPDATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_updated_1} ${id}
[Tags] {{ m.name }}
-Get {{ m.name }} RETRIEVE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
+Get {{ m.name }} RETRIEVE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
[Tags] {{ m.name }}
-Delete {{ m.name }} DELETE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s data_id=${id}
+Delete {{ m.name }} DELETE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} data_id=${id}
[Tags] {{ m.name }}
-{% else %}
-Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_1}
- [Tags] {{ m.name }}
-
-Update {{ m.name }} UPDATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_updated_1} ${id}
- [Tags] {{ m.name }}
-
-Get {{ m.name }} RETRIEVE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
- [Tags] {{ m.name }}
-
-Delete {{ m.name }} DELETE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es data_id=${id}
- [Tags] {{ m.name }}
-{% endif -%}
{% endif -%}
{% endif -%}
{% endfor %}