Skip to content

tests: add pytest-based unit tests - #147

Open
Ali Erdinc Koroglu (aekoroglu) wants to merge 1 commit into
qualcomm-linux:mainfrom
aekoroglu:main
Open

tests: add pytest-based unit tests#147
Ali Erdinc Koroglu (aekoroglu) wants to merge 1 commit into
qualcomm-linux:mainfrom
aekoroglu:main

Conversation

@aekoroglu

Copy link
Copy Markdown
Contributor

Add pytest unit tests; shell integration checks untouched.

  • tests/unit/test_utils.py: CalcCRC32 verified against binascii.crc32 (implementation matches standard CRC-32/IEEE reflected), reflect() properties, EnsureDirectoryExists behavior.
  • tests/unit/test_gen_partition.py: end-to-end coverage of gen_partition via subprocess (the module runs its main logic at import time), covering KB/MB/GB size parsing, GPT attribute bits (bootable/readonly), -m image map overrides, multi-LUN ordering, and error paths.
  • tests/unit/test_cli.py: qcom-ptool dispatcher (--version, --help, invalid subcommand, dispatch to each legacy script).

Add pytest unit tests; shell integration checks untouched.

- tests/unit/test_utils.py: CalcCRC32 verified against binascii.crc32
  (implementation matches standard CRC-32/IEEE reflected), reflect()
  properties, EnsureDirectoryExists behavior.
- tests/unit/test_gen_partition.py: end-to-end coverage of gen_partition
  via subprocess (the module runs its main logic at import time), covering
  KB/MB/GB size parsing, GPT attribute bits (bootable/readonly), -m image
  map overrides, multi-LUN ordering, and error paths.
- tests/unit/test_cli.py: qcom-ptool dispatcher (--version, --help,
  invalid subcommand, dispatch to each legacy script).

Signed-off-by: Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant