Adding tests to cover scripts/extract-partitions.py better

WIP. I'll add in the checklist once it is ready to merge.