mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 06:56:18 -05:00
Using two baz to force order of test result.
This commit is contained in:
parent
e25c92a30b
commit
9b3f527f96
2 changed files with 3 additions and 4 deletions
|
|
@ -157,7 +157,6 @@ def search(search_str: str, limit: int, offset: int):
|
|||
SELECT id, ts_rank_cd(textsearch, websearch_to_tsquery(%(search_str)s)), COUNT(*) OVER() AS total
|
||||
FROM file
|
||||
WHERE textsearch @@ websearch_to_tsquery(%(search_str)s)
|
||||
ORDER BY 1, 2
|
||||
OFFSET %(offset)s LIMIT %(limit)s
|
||||
'''
|
||||
params = dict(search_str=search_str, offset=offset, limit=limit)
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ def test_files_search(test_session, test_client, make_files_structure):
|
|||
'foo_is_the_name.txt',
|
||||
'archives/bar.txt',
|
||||
'baz.mp4',
|
||||
'baz two.mp4'
|
||||
'baz baz two.mp4'
|
||||
]
|
||||
foo, bar, baz, baz2 = make_files_structure(files)
|
||||
foo.write_text('foo contents')
|
||||
|
|
@ -152,8 +152,8 @@ def test_files_search(test_session, test_client, make_files_structure):
|
|||
do_search(test_client, 'foo', 1, [dict(path='foo_is_the_name.txt', mimetype='text/plain', size=12)])
|
||||
do_search(test_client, 'bar', 1, [dict(path='archives/bar.txt', mimetype='text/plain', size=16)])
|
||||
do_search(test_client, 'baz', 2, [
|
||||
dict(path='baz two.mp4', mimetype='video/mp4', size=1055736),
|
||||
dict(path='baz baz two.mp4', mimetype='video/mp4', size=1055736),
|
||||
dict(path='baz.mp4', mimetype='video/mp4', size=1055736),
|
||||
])
|
||||
do_search(test_client, 'two', 1, [dict(path='baz two.mp4', mimetype='video/mp4', size=1055736)])
|
||||
do_search(test_client, 'two', 1, [dict(path='baz baz two.mp4', mimetype='video/mp4', size=1055736)])
|
||||
do_search(test_client, 'nothing', 0, [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue