(self, filename)
| 741 | self.assertEqual(result, unpickled) |
| 742 | |
| 743 | def check_statx_attributes(self, filename): |
| 744 | maximal_mask = 0 |
| 745 | for name in dir(os): |
| 746 | if name.startswith('STATX_'): |
| 747 | maximal_mask |= getattr(os, name) |
| 748 | result = os.statx(filename, maximal_mask) |
| 749 | stat_result = os.stat(filename) |
| 750 | |
| 751 | time_attributes = ('stx_atime', 'stx_btime', 'stx_ctime', 'stx_mtime') |
| 752 | # gh-83714: stx_btime can be None on tmpfs even if STATX_BTIME mask |
| 753 | # is used |
| 754 | time_attributes = [name for name in time_attributes |
| 755 | if getattr(result, name) is not None] |
| 756 | self.check_timestamp_agreement(result, time_attributes) |
| 757 | |
| 758 | def getmask(name): |
| 759 | return getattr(os, name, 0) |
| 760 | |
| 761 | requirements = ( |
| 762 | ('stx_atime', os.STATX_ATIME), |
| 763 | ('stx_atime_ns', os.STATX_ATIME), |
| 764 | ('stx_atomic_write_segments_max', getmask('STATX_WRITE_ATOMIC')), |
| 765 | ('stx_atomic_write_unit_max', getmask('STATX_WRITE_ATOMIC')), |
| 766 | ('stx_atomic_write_unit_max_opt', getmask('STATX_WRITE_ATOMIC')), |
| 767 | ('stx_atomic_write_unit_min', getmask('STATX_WRITE_ATOMIC')), |
| 768 | ('stx_attributes', 0), |
| 769 | ('stx_attributes_mask', 0), |
| 770 | ('stx_blksize', 0), |
| 771 | ('stx_blocks', os.STATX_BLOCKS), |
| 772 | ('stx_btime', os.STATX_BTIME), |
| 773 | ('stx_btime_ns', os.STATX_BTIME), |
| 774 | ('stx_ctime', os.STATX_CTIME), |
| 775 | ('stx_ctime_ns', os.STATX_CTIME), |
| 776 | ('stx_dev', 0), |
| 777 | ('stx_dev_major', 0), |
| 778 | ('stx_dev_minor', 0), |
| 779 | ('stx_dio_mem_align', getmask('STATX_DIOALIGN')), |
| 780 | ('stx_dio_offset_align', getmask('STATX_DIOALIGN')), |
| 781 | ('stx_dio_read_offset_align', getmask('STATX_DIO_READ_ALIGN')), |
| 782 | ('stx_gid', os.STATX_GID), |
| 783 | ('stx_ino', os.STATX_INO), |
| 784 | ('stx_mask', 0), |
| 785 | ('stx_mnt_id', getmask('STATX_MNT_ID')), |
| 786 | ('stx_mode', os.STATX_TYPE | os.STATX_MODE), |
| 787 | ('stx_mtime', os.STATX_MTIME), |
| 788 | ('stx_mtime_ns', os.STATX_MTIME), |
| 789 | ('stx_nlink', os.STATX_NLINK), |
| 790 | ('stx_rdev', 0), |
| 791 | ('stx_rdev_major', 0), |
| 792 | ('stx_rdev_minor', 0), |
| 793 | ('stx_size', os.STATX_SIZE), |
| 794 | ('stx_subvol', getmask('STATX_SUBVOL')), |
| 795 | ('stx_uid', os.STATX_UID), |
| 796 | ) |
| 797 | optional_members = { |
| 798 | 'stx_atomic_write_segments_max', |
| 799 | 'stx_atomic_write_unit_max', |
| 800 | 'stx_atomic_write_unit_max_opt', |
no test coverage detected