| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -168,6 +168,11 @@ | |||
| 168 | 168 | # -------------------------------------------------------------- | |
| 169 | 169 | "diagnostics", | |
| 170 | 170 | "HookOrderError", | |
| 171 | + # -------------------------------------------------------------- | ||
| 172 | + # Thin functional aliases: one-line wrappers over a value that is | ||
| 173 | + # already covered elsewhere. | ||
| 174 | + # -------------------------------------------------------------- | ||
| 175 | + "get_platform", # thin functional alias of Platform.OS | ||
| 171 | 176 | } | |
| 172 | 177 | ||
| 173 | 178 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,7 +167,7 @@ def App(): | |||
| 167 | 167 | use_route, | |
| 168 | 168 | ) | |
| 169 | 169 | from .net import HTTPError, Response, fetch | |
| 170 | - from .platform import Platform | ||
| 170 | + from .platform import Platform, get_platform | ||
| 171 | 171 | from .runtime import run_async, run_blocking | |
| 172 | 172 | from .scheduler import batch_updates | |
| 173 | 173 | from .sdk import ( | |
@@ -379,6 +379,7 @@ def App(): | |||
| 379 | 379 | "diagnostics", | |
| 380 | 380 | # Platform | |
| 381 | 381 | "Platform", | |
| 382 | + "get_platform", | ||
| 382 | 383 | # Custom-component SDK | |
| 383 | 384 | "Props", | |
| 384 | 385 | "ViewHandler", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | 7 | import pytest | |
| 8 | 8 | ||
| 9 | + import pythonnative as pn | ||
| 9 | 10 | from pythonnative.platform import Platform, _set_platform_for_test, get_platform | |
| 10 | 11 | ||
| 11 | 12 | ||
@@ -27,6 +28,10 @@ def test_get_platform_matches_os() -> None: | |||
| 27 | 28 | assert get_platform() == Platform.OS | |
| 28 | 29 | ||
| 29 | 30 | ||
| 31 | + def test_get_platform_exported_from_package() -> None: | ||
| 32 | + assert pn.get_platform() == pn.Platform.OS | ||
| 33 | + | ||
| 34 | + | ||
| 30 | 35 | def test_version_string_present() -> None: | |
| 31 | 36 | assert isinstance(Platform.Version, str) | |
| 32 | 37 | assert len(Platform.Version) > 0 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments