Skip to content

Commit

Permalink
add tests for get_spinner_symbols()
Browse files Browse the repository at this point in the history
  • Loading branch information
fohrloop committed Sep 20, 2024
1 parent 4458f5a commit 42640d6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unit/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from wakepy import ActivationResult, Method
from wakepy.__main__ import (
_get_activation_error_text,
get_spinner_symbols,
get_startup_text,
handle_activation_error,
main,
Expand All @@ -16,6 +17,7 @@
)
from wakepy.core import PlatformType
from wakepy.core.constants import ModeName
from wakepy.core.platform import IdentifiedPlatformType


@pytest.fixture
Expand Down Expand Up @@ -214,3 +216,14 @@ def sys_argv(self):
# The patched value for sys.argv. Does not matter here otherwise, but
# should be a list of at least two items.
return ["", ""]


class TestGetSpinnerSymbols:
@patch("wakepy.__main__.CURRENT_PLATFORM", IdentifiedPlatformType.LINUX)
def test_on_linux(self):
assert get_spinner_symbols() == ["⢎⡰", "⢎⡡", "⢎⡑", "⢎⠱", "⠎⡱", "⢊⡱", "⢌⡱", "⢆⡱"]

@patch("wakepy.__main__.CURRENT_PLATFORM", IdentifiedPlatformType.WINDOWS)
@patch("wakepy.__main__.platform.python_implementation", lambda: "PyPy")
def test_on_windows_pypy(self):
assert get_spinner_symbols() == ["|", "/", "-", "\\"]

0 comments on commit 42640d6

Please sign in to comment.