Exemplo n.º 1
0
    def test_convert_good_cvsdate(self):
        """dateutils - conversion of good CVS dates"""
        # here we have to use '$' + 'Date...' here, otherwise the CVS
        # commit would erase this time format to put commit date:
        datecvs = "$" + "Date: 2006/09/21 10:07:22 $"
        datestruct_beginning_expected = (2006, 9, 21, 10, 7, 22)
        self.assertEqual(dateutils.convert_datecvs_to_datestruct(datecvs)[:6],
                         datestruct_beginning_expected)

        # here we have to use '$' + 'Date...' here, otherwise the CVS
        # commit would erase this time format to put commit date:
        datecvs = "$" + "Id: dateutils_tests.py,v 1.6 2007/02/14 18:33:02 tibor Exp $"
        datestruct_beginning_expected = (2007, 2, 14, 18, 33, 02)
        self.assertEqual(dateutils.convert_datecvs_to_datestruct(datecvs)[:6],
                         datestruct_beginning_expected)
Exemplo n.º 2
0
    def test_convert_good_cvsdate(self):
        """dateutils - conversion of good CVS dates"""
        # here we have to use '$' + 'Date...' here, otherwise the CVS
        # commit would erase this time format to put commit date:
        datecvs = "$" + "Date: 2006/09/21 10:07:22 $"
        datestruct_beginning_expected = (2006, 9, 21, 10, 7, 22)
        self.assertEqual(dateutils.convert_datecvs_to_datestruct(datecvs)[:6],
                         datestruct_beginning_expected)

        # here we have to use '$' + 'Date...' here, otherwise the CVS
        # commit would erase this time format to put commit date:
        datecvs = "$" + "Id: dateutils_tests.py,v 1.6 2007/02/14 18:33:02 tibor Exp $"
        datestruct_beginning_expected = (2007, 2, 14, 18, 33, 02)
        self.assertEqual(dateutils.convert_datecvs_to_datestruct(datecvs)[:6],
                         datestruct_beginning_expected)
Exemplo n.º 3
0
 def test_convert_bad_cvsdate(self):
     """dateutils - conversion of bad CVS dates"""
     # here we have to use '$' + 'Date...' here, otherwise the CVS
     # commit would erase this time format to put commit date:
     datecvs = "$" + "Date: 2006/AA/21 10:07:22 $"
     datestruct_beginning_expected = (0, 0, 0, 0, 0, 0)
     self.assertEqual(dateutils.convert_datecvs_to_datestruct(datecvs)[:6],
                      datestruct_beginning_expected)
Exemplo n.º 4
0
 def test_convert_bad_cvsdate(self):
     """dateutils - conversion of bad CVS dates"""
     # here we have to use '$' + 'Date...' here, otherwise the CVS
     # commit would erase this time format to put commit date:
     datecvs = "$" + "Date: 2006/AA/21 10:07:22 $"
     datestruct_beginning_expected = (0, 0, 0, 0, 0, 0)
     self.assertEqual(dateutils.convert_datecvs_to_datestruct(datecvs)[:6],
                      datestruct_beginning_expected)