Merge "Fix marker pagination for /servers"
This commit is contained in:
commit
1d70b53ba8
@ -1067,6 +1067,10 @@ class InstanceNotFound(NotFound):
|
||||
message = _("Instance %(instance_id)s could not be found.")
|
||||
|
||||
|
||||
class MarkerNotFound(NotFound):
|
||||
message = _("Marker %(marker)s could not be found.")
|
||||
|
||||
|
||||
class InvalidInstanceIDMalformed(Invalid):
|
||||
message = _("Invalid id: %(val)s (expecting \"i-...\").")
|
||||
|
||||
|
@ -126,19 +126,24 @@ class DbApiTestCase(test.TestCase):
|
||||
result = db.instance_get_all_by_filters(self.context,
|
||||
{'display_name': '%test%'},
|
||||
sort_dir="asc",
|
||||
marker=test1)
|
||||
marker=test1['uuid'])
|
||||
self.assertEqual(2, len(result))
|
||||
result = db.instance_get_all_by_filters(self.context,
|
||||
{'display_name': '%test%'},
|
||||
sort_dir="asc",
|
||||
marker=test2)
|
||||
marker=test2['uuid'])
|
||||
self.assertEqual(1, len(result))
|
||||
result = db.instance_get_all_by_filters(self.context,
|
||||
{'display_name': '%test%'},
|
||||
sort_dir="asc",
|
||||
marker=test3)
|
||||
marker=test3['uuid'])
|
||||
self.assertEqual(0, len(result))
|
||||
|
||||
self.assertRaises(exception.MarkerNotFound,
|
||||
db.instance_get_all_by_filters,
|
||||
self.context, {'display_name': '%test%'},
|
||||
marker=str(utils.gen_uuid()))
|
||||
|
||||
def test_migration_get_unconfirmed_by_dest_compute(self):
|
||||
ctxt = context.get_admin_context()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user