~lisahj/gtg/taskgrouping

« back to all changes in this revision

Viewing changes to tests/core/test_search_query.py

  • Committer: Nimit Shah
  • Date: 2014-03-10 03:37:32 UTC
  • mfrom: (1360.2.18 test-cleanup)
  • Revision ID: nimit.svnit@gmail.com-20140310033732-n4od1z8npybs4ooc
Rework of test-suite, by Izidor Matušov

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
# -----------------------------------------------------------------------------
3
3
# Getting Things GNOME! - a personal organizer for the GNOME desktop
4
 
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
 
4
# Copyright (c) 2008-2014 - Lionel Dricot & Bertrand Rousseau
5
5
#
6
6
# This program is free software: you can redistribute it and/or modify it under
7
7
# the terms of the GNU General Public License as published by the Free Software
17
17
# this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
# -----------------------------------------------------------------------------
19
19
 
20
 
""" Tests for parsing searching query """
21
 
 
22
 
import unittest
 
20
from unittest import TestCase
23
21
from GTG.core.search import parse_search_query, InvalidQuery
24
22
from GTG.tools.dates import Date
25
23
 
27
25
d = Date.parse
28
26
 
29
27
 
30
 
class TestSearchQuery(unittest.TestCase):
 
28
class TestSearchQuery(TestCase):
31
29
 
32
30
    def test_word_query(self):
33
31
        self.assertEqual(parse("query"),
222
220
                         {'q': [('today', False)]})
223
221
        self.assertEqual(parse('word !today'),
224
222
                         {'q': [('word', True, 'word'), ('today', True)]})
225
 
 
226
 
 
227
 
def test_suite():
228
 
    return unittest.TestLoader().loadTestsFromName(__name__)