Automate generation of backups api-ref samples

This patch adds the following tests:

1) List Backup

Partially-Implements: blueprint generating-sample-files
Change-Id: I639e2786ce0fc8d0e9422704df9cdd50d3ea84ec
This commit is contained in:
Toheeb 2023-06-09 15:41:38 +01:00
parent d7ae9610d7
commit 4b082c22ce
4 changed files with 39 additions and 1 deletions

View File

@ -424,7 +424,7 @@ Response Parameters
Response Example
----------------
.. literalinclude:: ./samples/backups-list-response.json
.. literalinclude:: ./samples/backups/backups-list-response.json
:language: javascript

View File

@ -0,0 +1,18 @@
{
"backups": [
{
"id": "c26d9897-cace-44cc-ad0f-3a0d0b6d1450",
"links": [
{
"href": "http://127.0.0.1:46803/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/backups/c26d9897-cace-44cc-ad0f-3a0d0b6d1450",
"rel": "self"
},
{
"href": "http://127.0.0.1:46803/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/backups/c26d9897-cace-44cc-ad0f-3a0d0b6d1450",
"rel": "bookmark"
}
],
"name": "backup001"
}
]
}

View File

@ -0,0 +1,15 @@
{
"backups": [
{
"id": "%(uuid)s",
"links": [{
"href": "%(host)s/v3/%(id)s/backups/%(uuid)s",
"rel": "self"
}, {
"href": "%(host)s/%(id)s/backups/%(uuid)s",
"rel": "bookmark"
}],
"name": "backup001"
}
]
}

View File

@ -34,3 +34,8 @@ class BackupClassesSampleJsonTest(test_base.VolumesSampleBase):
def test_backup_create(self):
self._verify_response('backup-create-response',
{}, self.response, 202)
def test_backup_list(self):
response = self._do_get('backups')
self._verify_response('backups-list-response',
{}, response, 200)