dcantrell / pyparted

Python bindings for GNU parted (libparted)
GNU General Public License v2.0
86 stars 43 forks source link

tests: Test to make sure partition and disk names match libparted #93

Open bcl opened 2 years ago

bcl commented 2 years ago

In the past there have been problems with pyparted not including all of the partition flags from libparted due to it's use of enums in the _LAST macros. These were not caught by the tests because they skipped flags that had no attribute (a valid case when building against an older parted).

This adds tests that include all known parted flags, and uses libparted to decide which ones must be included. The test will return errors for all flags that libparted reports that are not attributes of _ped

If libparted reports a flag that pyparted does not support it is not a failure and will be reported as a skipped test:

skipped 'Unknown flag: linux-home'
bcl commented 2 years ago

Cool, the new test is working. It's running against F36 where the new parted hasn't gone stable yet, so it is reporting that it is missing the known flags.

dcantrell commented 2 years ago

I like this change, but the unit tests have failed.