FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(package): export get_platform by glenlouis8 · Pull Request #48 · pythonnative/pythonnative · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions scripts/check-e2e-coverage.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@
# --------------------------------------------------------------
"diagnostics",
"HookOrderError",
# --------------------------------------------------------------
# Thin functional aliases: one-line wrappers over a value that is
# already covered elsewhere.
# --------------------------------------------------------------
"get_platform", # thin functional alias of Platform.OS
}


Expand Down
3 changes: 2 additions & 1 deletion src/pythonnative/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def App():
use_route,
)
from .net import HTTPError, Response, fetch
from .platform import Platform
from .platform import Platform, get_platform
from .runtime import run_async, run_blocking
from .screen import create_screen
from .sdk import (
Expand Down Expand Up @@ -367,6 +367,7 @@ def App():
"diagnostics",
# Platform
"Platform",
"get_platform",
# Custom-component SDK
"Props",
"ViewHandler",
Expand Down
5 changes: 5 additions & 0 deletions tests/test_platform.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest

import pythonnative as pn
from pythonnative.platform import Platform, _set_platform_for_test, get_platform


Expand All @@ -27,6 +28,10 @@ def test_get_platform_matches_os() -> None:
assert get_platform() == Platform.OS


def test_get_platform_exported_from_package() -> None:
assert pn.get_platform() == pn.Platform.OS


def test_version_string_present() -> None:
assert isinstance(Platform.Version, str)
assert len(Platform.Version) > 0
Expand Down
Loading

Back | FazBrowse Home | New Git URL