scalebrowser 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/PKG-INFO +1 -1
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/pyproject.toml +1 -1
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/_version.py +1 -1
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/client.py +3 -2
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/models_control.py +9 -2
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_coverage.py +6 -4
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/.gitignore +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/LICENSE +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/README.md +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/examples/quickstart.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/examples/quickstart_sync.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/__init__.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/_http.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/_sync.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/cdp.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/errors.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/events.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/models.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/models_identity.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/src/scalebrowser/models_runs.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/__init__.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/conftest.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_cdp.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_client.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_e2e.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_errors.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_events.py +0 -0
- {scalebrowser-0.2.0 → scalebrowser-0.3.0}/tests/test_sync.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: scalebrowser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Official Python SDK for the Scalebrowser daemon — typed REST client + direct-CDP driver (nodriver-style).
|
|
5
5
|
Project-URL: Homepage, https://scalebrowser.net
|
|
6
6
|
Project-URL: Documentation, https://scalebrowser.net
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scalebrowser"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "Official Python SDK for the Scalebrowser daemon — typed REST client + direct-CDP driver (nodriver-style)."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -755,8 +755,9 @@ class AsyncScalebrowserClient:
|
|
|
755
755
|
"""Licence state for display. The launch gate stays the authority on starts.
|
|
756
756
|
|
|
757
757
|
A daemon predating the route answers 404, and that is not an error worth
|
|
758
|
-
raising
|
|
759
|
-
|
|
758
|
+
raising -- but it is read pessimistically (DEC-014): the defaults of
|
|
759
|
+
:class:`Account` say nothing is connected and nothing may start. Same
|
|
760
|
+
tolerance as :meth:`get_metrics`.
|
|
760
761
|
"""
|
|
761
762
|
try:
|
|
762
763
|
data = await self._t.get("/v1/account")
|
|
@@ -99,8 +99,13 @@ class Account(_ReadModel):
|
|
|
99
99
|
profile the launch gate refuses is worse than no light.
|
|
100
100
|
"""
|
|
101
101
|
|
|
102
|
-
#:
|
|
102
|
+
#: Whether an entitlement snapshot has arrived. Also ``False`` in the seconds
|
|
103
|
+
#: between signing in and the first refresh, so it never answers "is this
|
|
104
|
+
#: machine connected to an account" -- ``signed_in`` does.
|
|
103
105
|
licensed: bool = False
|
|
106
|
+
#: Whether an account is connected to this machine. One without an account
|
|
107
|
+
#: starts no browser (DEC-014).
|
|
108
|
+
signed_in: bool = False
|
|
104
109
|
plan: Optional[str] = None
|
|
105
110
|
status: Optional[str] = None
|
|
106
111
|
#: Browsers the subscription may run AT ONCE. Replaced the profile allowance
|
|
@@ -113,7 +118,9 @@ class Account(_ReadModel):
|
|
|
113
118
|
features: list[str] = []
|
|
114
119
|
#: Unix seconds; when the cached entitlement stops being valid.
|
|
115
120
|
expires_at: Optional[int] = None
|
|
116
|
-
|
|
121
|
+
#: Defaults to False: a daemon too old to send the field is a daemon that
|
|
122
|
+
#: cannot be shown to permit anything.
|
|
123
|
+
permits_launch: bool = False
|
|
117
124
|
|
|
118
125
|
|
|
119
126
|
class HealthStatus(_ReadModel):
|
|
@@ -242,16 +242,18 @@ async def test_cookie_values_need_the_vault_password() -> None:
|
|
|
242
242
|
assert b"vault_password" in captured[0].content
|
|
243
243
|
|
|
244
244
|
|
|
245
|
-
async def
|
|
245
|
+
async def test_account_reads_a_404_pessimistically() -> None:
|
|
246
246
|
def handler(request: httpx.Request) -> httpx.Response:
|
|
247
247
|
return httpx.Response(404, json={"code": 4001, "message": "no route"})
|
|
248
248
|
|
|
249
|
-
# A daemon
|
|
250
|
-
#
|
|
249
|
+
# A daemon too old to serve the route is not an error worth raising, but it is
|
|
250
|
+
# also not a daemon that can be SHOWN to permit anything: since DEC-014 an
|
|
251
|
+
# unanswered account reads as "nothing connected, nothing permitted".
|
|
251
252
|
sb = make_async_client(handler)
|
|
252
253
|
account = await sb.get_account()
|
|
253
254
|
assert account.licensed is False
|
|
254
|
-
assert account.
|
|
255
|
+
assert account.signed_in is False
|
|
256
|
+
assert account.permits_launch is False
|
|
255
257
|
|
|
256
258
|
|
|
257
259
|
async def test_health_and_account() -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|