list devices by non exist vendor

add list devices by non exist vendor testcase

Change-Id: Iea3b73a5386789e05b030c12c658046149d084eb
This commit is contained in:
wangzhiguang 2022-07-18 15:28:12 +08:00
parent c0271b53bd
commit 702d7547c6
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ class TestDevice(base.BaseAPITest):
for dv in response['devices']:
self.assertEqual(vendor, dv['vendor'])
def test_list_devices_filter_by_non_exist_vendor(self):
# list devices filter by non exist vendor
params = {"vendor": "fake_vendor"}
response = self.os_admin.cyborg_client.list_devices(params=params)
self.assertEmpty(response['devices'])
def test_list_devices_filter_by_hostname(self):
response = self.os_admin.cyborg_client.list_devices()
hostname = response['devices'][0]['hostname']