~saurabhanandiit/gtg/exportFixed

« back to all changes in this revision

Viewing changes to GTG/tests/test_dates.py

Merge of my work on liblarch newbase and all the backends ported to liblarch
(which mainly means porting the datastore).
One failing test, will check it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# -----------------------------------------------------------------------------
 
3
# Gettings Things Gnome! - a personal organizer for the GNOME desktop
 
4
# Copyright (c) 2008-2009 - Lionel Dricot & Bertrand Rousseau
 
5
#
 
6
# This program is free software: you can redistribute it and/or modify it under
 
7
# the terms of the GNU General Public License as published by the Free Software
 
8
# Foundation, either version 3 of the License, or (at your option) any later
 
9
# version.
 
10
#
 
11
# This program is distributed in the hope that it will be useful, but WITHOUT
 
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
13
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 
14
# details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License along with
 
17
# this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
# -----------------------------------------------------------------------------
 
19
 
 
20
'''
 
21
Tests for the various Date classes
 
22
'''
 
23
 
 
24
import unittest
 
25
 
 
26
from GTG.tools.dates import get_canonical_date
 
27
 
 
28
class TestDates(unittest.TestCase):
 
29
    '''
 
30
    Tests for the various Date classes
 
31
    '''
 
32
 
 
33
    def test_get_canonical_date(self):
 
34
        '''
 
35
        Tests for "get_canonical_date"
 
36
        '''
 
37
        for str in ["1985-03-29", "now", "soon", "later", ""]:
 
38
            date = get_canonical_date(str)
 
39
            self.assertEqual(date.__str__(), str)
 
40
 
 
41
def test_suite():
 
42
    return unittest.TestLoader().loadTestsFromTestCase(TestDates)
 
43