Esempio n. 1
0
    def test_to_datetime(self):
        march_15_timestamp = 1363320000000
        march_15_datetime = utils.to_datetime(march_15_timestamp)

        self.assertEqual(march_15_datetime.year, 2013)
        self.assertEqual(march_15_datetime.month, 3)
        self.assertEqual(march_15_datetime.day, 15)
Esempio n. 2
0
    def test_to_datetime(self):
        march_15_timestamp = 1363320000000
        march_15_datetime = utils.to_datetime(march_15_timestamp)

        self.assertEqual(march_15_datetime.year, 2013)
        self.assertEqual(march_15_datetime.month, 3)
        self.assertEqual(march_15_datetime.day, 15)
Esempio n. 3
0
 def test_to_datetime_bad_date(self):
     march_15_timestamp = "something"
     self.assertEqual(utils.to_datetime(march_15_timestamp), "something")
Esempio n. 4
0
 def test_not_list_split(self):
     item = mock.Mock()
     item.split.return_value = "Something"
     self.assertEqual(utils.to_datetime(item), item)
Esempio n. 5
0
 def test_to_datetime_bad_date(self):
     march_15_timestamp = 'something'
     self.assertEqual(utils.to_datetime(march_15_timestamp), 'something')
Esempio n. 6
0
 def test_not_list_split(self):
     item = mock.Mock()
     item.split.return_value = 'Something'
     self.assertEqual(utils.to_datetime(item), item)