예제 #1
0
    def test_dirs_in_period(self):
        mart = TestHelper.random_name()
        date1 = Date.tz_berlin(2014,4,1)
        date2 = Date.tz_berlin(2014,4,2)
        TestHelper.mkdir('/tmp/' + mart)
        TestHelper.mkdir('/tmp/' + mart + '/' + str(date1.seconds()))

        dirs = self.fs.dirs_of_period(mart, '',  date1.seconds(), date2.seconds())
        self.assertEqual(['/tmp/' + mart + '/' + str(date1.seconds())], dirs)
예제 #2
0
    def test_dirs_in_period(self):
        mart = TestHelper.random_name()
        date1 = Date.tz_berlin(2014, 4, 1)
        date2 = Date.tz_berlin(2014, 4, 2)
        TestHelper.mkdir('/tmp/' + mart)
        TestHelper.mkdir('/tmp/' + mart + '/' + str(date1.seconds()))

        dirs = self.fs.dirs_of_period(mart, '', date1.seconds(),
                                      date2.seconds())
        self.assertEqual(['/tmp/' + mart + '/' + str(date1.seconds())], dirs)
예제 #3
0
파일: test_date.py 프로젝트: Fabma/peachbox
 def test_tz_berlin(self):
     d = Date.tz_berlin(2014,4,2)
     self.assertEqual(2014, d.datetime().year)
     self.assertEqual(4, d.datetime().month)
     self.assertEqual(2, d.datetime().day)
     d2 = pytz.timezone('Europe/Berlin').localize(datetime(2014,4,2))
     self.assertEqual(d2, d.datetime())
예제 #4
0
 def test_tz_berlin(self):
     d = Date.tz_berlin(2014, 4, 2)
     self.assertEqual(2014, d.datetime().year)
     self.assertEqual(4, d.datetime().month)
     self.assertEqual(2, d.datetime().day)
     d2 = pytz.timezone('Europe/Berlin').localize(datetime(2014, 4, 2))
     self.assertEqual(d2, d.datetime())
예제 #5
0
파일: test_date.py 프로젝트: Fabma/peachbox
 def test_from_utime(self):
     utime = Date.tz_berlin(2014,3,1).seconds()
     d = Date.from_utc_utime(pytz.timezone('Europe/Berlin'), utime)
     self.assertEqual(utime, d.seconds())
예제 #6
0
 def test_from_utime(self):
     utime = Date.tz_berlin(2014, 3, 1).seconds()
     d = Date.from_utc_utime(pytz.timezone('Europe/Berlin'), utime)
     self.assertEqual(utime, d.seconds())