Merge "Reverse-listings follow-up"
This commit is contained in:
commit
dc774390da
@ -446,7 +446,7 @@ class AccountBroker(DatabaseBroker):
|
||||
else:
|
||||
marker = name
|
||||
|
||||
if len(results) >= limit or not name.startswith(prefix):
|
||||
if len(results) >= limit:
|
||||
curs.close()
|
||||
return results
|
||||
end = name.find(delimiter, len(prefix))
|
||||
|
@ -660,7 +660,7 @@ class ContainerBroker(DatabaseBroker):
|
||||
else:
|
||||
marker = name
|
||||
|
||||
if len(results) >= limit or not name.startswith(prefix):
|
||||
if len(results) >= limit:
|
||||
curs.close()
|
||||
return results
|
||||
end = name.find(delimiter, len(prefix))
|
||||
|
@ -619,6 +619,27 @@ class TestAccountBroker(unittest.TestCase):
|
||||
'topdir1-subdir1,',
|
||||
],
|
||||
},
|
||||
{
|
||||
'containers': [
|
||||
'1',
|
||||
'2',
|
||||
'3:1',
|
||||
'3:2:1',
|
||||
'3:2:2',
|
||||
'3:3',
|
||||
'4',
|
||||
],
|
||||
'params': {
|
||||
'prefix': '3:',
|
||||
'delimiter': ':',
|
||||
'reverse': True,
|
||||
},
|
||||
'expected': [
|
||||
'3:3',
|
||||
'3:2:',
|
||||
'3:1',
|
||||
],
|
||||
},
|
||||
]
|
||||
ts = make_timestamp_iter()
|
||||
default_listing_params = {
|
||||
|
@ -962,6 +962,47 @@ class TestContainerBroker(unittest.TestCase):
|
||||
'topdir1/subdir1.0/',
|
||||
],
|
||||
},
|
||||
{
|
||||
'objects': [
|
||||
'1',
|
||||
'2',
|
||||
'3/1',
|
||||
'3/2.2',
|
||||
'3/2/1',
|
||||
'3/2/2',
|
||||
'3/3',
|
||||
'4',
|
||||
],
|
||||
'params': {
|
||||
'path': '3/',
|
||||
},
|
||||
'expected': [
|
||||
'3/1',
|
||||
'3/2.2',
|
||||
'3/3',
|
||||
],
|
||||
},
|
||||
{
|
||||
'objects': [
|
||||
'1',
|
||||
'2',
|
||||
'3/1',
|
||||
'3/2.2',
|
||||
'3/2/1',
|
||||
'3/2/2',
|
||||
'3/3',
|
||||
'4',
|
||||
],
|
||||
'params': {
|
||||
'path': '3/',
|
||||
'reverse': True,
|
||||
},
|
||||
'expected': [
|
||||
'3/3',
|
||||
'3/2.2',
|
||||
'3/1',
|
||||
],
|
||||
},
|
||||
]
|
||||
ts = make_timestamp_iter()
|
||||
default_listing_params = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user