File: test_inquirer.py

package info (click to toggle)
python-inquirerpy 0.3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,088 kB
  • sloc: python: 9,463; makefile: 15
file content (20 lines) | stat: -rw-r--r-- 648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import re
import unittest

from InquirerPy import inquirer
from InquirerPy.resolver import question_mapping


class TestInquirer(unittest.TestCase):
    def test_pkgs(self) -> None:
        inquirer_lookup = set()
        special_mapping = {"password": "secret", "input": "text", "list": "select"}
        for pkg in dir(inquirer):
            dunder_pattern = re.compile(r"^__.*")
            if not dunder_pattern.match(pkg):
                inquirer_lookup.add(pkg)

        for prompt in question_mapping.keys():
            prompt = special_mapping.get(prompt, prompt)
            if prompt not in inquirer_lookup:
                self.fail()