(cls, term)
| 58 | |
| 59 | @classmethod |
| 60 | def infocmp(cls, term) -> list[str]: |
| 61 | all_caps = [] |
| 62 | try: |
| 63 | result = subprocess.run( |
| 64 | ["infocmp", "-l1", term], |
| 65 | capture_output=True, |
| 66 | text=True, |
| 67 | check=True, |
| 68 | ) |
| 69 | except Exception: |
| 70 | raise unittest.SkipTest("calling `infocmp` failed on the system") |
| 71 | |
| 72 | for line in result.stdout.splitlines(): |
| 73 | line = line.strip() |
| 74 | if line.startswith("#"): |
| 75 | if "terminfo" not in line and "termcap" in line: |
| 76 | # PyREPL terminfo doesn't parse termcap databases |
| 77 | raise unittest.SkipTest( |
| 78 | "curses using termcap.db: no terminfo database on" |
| 79 | " the system" |
| 80 | ) |
| 81 | elif "=" in line: |
| 82 | cap_name = line.split("=")[0] |
| 83 | all_caps.append(cap_name) |
| 84 | |
| 85 | return all_caps |
| 86 | |
| 87 | def test_setupterm_basic(self): |
| 88 | """Test basic setupterm functionality.""" |
no test coverage detected