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)
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)
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())
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())
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())
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())