def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" apfs_time_object = apfs_time.APFSTime(timestamp=9223372036854775810) date_time_string = apfs_time_object.CopyToDateTimeString() self.assertIsNone(date_time_string) apfs_time_object = apfs_time.APFSTime() date_time_string = apfs_time_object.CopyToDateTimeString() self.assertIsNone(date_time_string)
def added_time(self): """dfdatetime.DateTimeValues: added time or None if not available.""" timestamp = self._fsapfs_file_entry.get_added_time_as_integer() if timestamp is None: return None return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)
def testGetNormalizedTimestamp(self): """Tests the _GetNormalizedTimestamp function.""" apfs_time_object = apfs_time.APFSTime(timestamp=1281643591987654321) normalized_timestamp = apfs_time_object._GetNormalizedTimestamp() self.assertEqual(normalized_timestamp, decimal.Decimal('1281643591.987654321')) apfs_time_object = apfs_time.APFSTime() normalized_timestamp = apfs_time_object._GetNormalizedTimestamp() self.assertIsNone(normalized_timestamp) apfs_time_object = apfs_time.APFSTime(timestamp=9223372036854775810) date_time_string = apfs_time_object._GetNormalizedTimestamp() self.assertIsNone(date_time_string)
def testCopyFromDateTimeString(self): """Tests the CopyFromDateTimeString function.""" apfs_time_object = apfs_time.APFSTime() with self.assertRaises(ValueError): apfs_time_object.CopyFromDateTimeString('2554-07-21 23:34:34.000000')
def modification_time(self): """dfdatetime.DateTimeValues: modification time or None if not available.""" timestamp = self._fsapfs_file_entry.get_modification_time_as_integer() return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)
def change_time(self): """dfdatetime.DateTimeValues: change time or None if not available.""" timestamp = self._fsapfs_file_entry.get_inode_change_time_as_integer() return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)