def test_iso_timestamp_with_ms(self): d = datetime(2012, 01, 01, 10, 30, 45, 434000) data = process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45.434' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], d)
def test_timestamp_iso_timestamp_with_Z(self): data = process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45Z' }) d = datetime.datetime(2012, 01, 01, 10, 30, 45) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], d)
def test_timestamp_iso_timestamp_with_Z(self): data = process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45Z' }) d = datetime.datetime(2012, 01, 01, 10, 30, 45) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], d)
def test_timestamp_iso_timestamp_with_Z(self): d = datetime(2012, 01, 01, 10, 30, 45) data = process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45Z' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], 1325413845.0)
def test_iso_timestamp(self): d = datetime(2012, 01, 01, 10, 30, 45) data = process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], d)
def test_iso_timestamp_with_ms(self): d = datetime(2012, 01, 01, 10, 30, 45, 434000) data = process_data_timestamp({ 'timestamp': '2012-01-01T10:30:45.434' }, current_datetime=d) self.assertTrue('timestamp' in data) self.assertEquals(data['timestamp'], 1325413845.0)
def test_timestamp_iso_timestamp_with_Z(self): data = process_data_timestamp({"timestamp": "2012-01-01T10:30:45Z"}) d = datetime.datetime(2012, 01, 01, 10, 30, 45) self.assertTrue("timestamp" in data) self.assertEquals(data["timestamp"], d)