X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/299a14ee0d61b7994dc4ce5246b55b4d75fdcb2e..d42e98caaaf4f07c8d1252236f03eb68b8be4619:/tests/search.py diff --git a/tests/search.py b/tests/search.py index 01ab893..7774d88 100755 --- a/tests/search.py +++ b/tests/search.py @@ -1,22 +1,20 @@ #! /usr/bin/env python # # This file is part of DisOrder. -# Copyright (C) 2007 Richard Kettlewell +# Copyright (C) 2007, 2008 Richard Kettlewell # -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA +# along with this program. If not, see . # import dtest,time,disorder,sys @@ -41,7 +39,8 @@ def check_search_results(terms, expected): def test(): """Check that the search produces the right results""" dtest.start_daemon() - time.sleep(2) # give rescan a chance + dtest.create_user() + dtest.rescan() global client client = disorder.client() first = ["Joe Bloggs/First Album/01:F\xC3\x8Crst track.ogg", @@ -88,6 +87,8 @@ def test(): check_search_results([u"fi\u0300rst"], first) check_search_results([u"THI\u0301RD"], third) check_search_results([u"thI\u0301rd"], third) + # stopwords shouldn't show up + check_search_results(["01"], []) if failures > 0: sys.exit(1)