File: test_pybuild_options.py

package info (click to toggle)
dh-python 7.20251231
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,596 kB
  • sloc: python: 6,487; makefile: 605; perl: 251; sh: 36
file content (20 lines) | stat: -rw-r--r-- 665 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from dataclasses import fields
from unittest import TestCase

from dhpython.build.options import build_parser, PybuildOptions


class TestPybuildOptions(TestCase):
    def test_args_match_options(self) -> None:
        parser = build_parser()
        parser_options = {action.dest for action in parser._get_optional_actions()} | {
            action.dest for action in parser._get_positional_actions()
        }
        # Built-ins
        parser_options -= {"help", "version"}

        options = {field.name for field in fields(PybuildOptions)}
        # Added in parse_args()
        options -= {"custom_tests"}

        self.assertEqual(parser_options, options)