Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions httpie/output/ui/man_pages.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Logic for checking and displaying man pages."""

import subprocess
import os
import subprocess
import sys
from httpie.context import Environment


Expand All @@ -18,7 +19,7 @@ def is_available(program: str) -> bool:
Check whether `program`'s man pages are available on this system.

"""
if NO_MAN_PAGES or os.system == 'nt':
if NO_MAN_PAGES or sys.platform == 'win32':
return False
try:
process = subprocess.run(
Expand Down
12 changes: 12 additions & 0 deletions tests/test_man_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from unittest.mock import Mock

from httpie.output.ui import man_pages


def test_man_pages_are_unavailable_on_windows(monkeypatch):
run = Mock()
monkeypatch.setattr(man_pages.sys, 'platform', 'win32')
monkeypatch.setattr(man_pages.subprocess, 'run', run)

assert man_pages.is_available('http') is False
run.assert_not_called()
Loading