예제 #1
0
  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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
 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')
예제 #5
0
 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)
예제 #6
0
 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)