mgr/dashboard: ensure limit 0 returns 0 images

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
Pere Diaz Bou 2022-08-18 13:34:15 +02:00
parent 78871e59c0
commit a80c058ad2

View File

@ -130,6 +130,12 @@ class RbdServiceTest(unittest.TestCase):
'namespace': ''
}
# test with limit 0, it should return a list of pools with an empty list, but
rbd_pool_list = RbdService.rbd_pool_list(['test_pool'], offset=0, limit=0)
self.assertEqual(rbd_pool_list, ([], 1))
self.rbd_inst_mock.namespace_list.return_value = []
rbd_pool_list = RbdService.rbd_pool_list(['test_pool'], offset=0, limit=5)
self.assertEqual(rbd_pool_list, ([{
'id': '3c1a5ee60a88',