lr-qrm 0.1.0__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lr-qrm
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: CLI client for interacting with Qestit QRM data from LumenRadio tooling.
5
5
  Author-email: Jonas Estberger <jonas.estberger@lumenradio.com>
6
6
  License: MIT License
@@ -57,30 +57,43 @@ By default, this stores session details at:
57
57
 
58
58
  ### Commands
59
59
 
60
+ #### Check API health
60
61
 
61
- Get test results for a serial number.
62
+ ```bash
63
+ qrm status
64
+ ```
65
+
66
+ #### Inspect UUT history
62
67
 
63
68
  ```bash
64
- qrm get-test-results P00Y00000001
69
+ qrm uut status 326115020010F2F1 --start "2026-02-01 00:00:00" --stop "2026-02-06 23:59:00"
65
70
  ```
66
71
 
72
+ By default the command uses `1970-01-01 00:00:00` as the start timestamp and "now" as the stop. Pass `--base-url` and `--insecure` to override the stored settings when needed.
67
73
 
68
74
  #### JSON output
69
75
 
70
76
  Most commands support a JSON output mode.
71
77
 
72
-
73
78
  ```bash
74
- $ qrm get-test-results P00Y00000001 --format json
79
+ qrm uut status 326115020010F2F1 --output json
75
80
  ```
76
81
 
77
82
  ## Programmatic use
78
83
 
79
84
  ```python
80
- from qrm import QrmClient, load_config
81
-
82
- client = QrmClient(load_config())
83
- results = client.get_test_results("P00Y00000001")
85
+ from qrm.config import load_login_state
86
+ from qrm.client import QrmClient
87
+
88
+ state = load_login_state()
89
+ client = QrmClient(base_url=str(state.base_url), verify_tls=state.verify_tls)
90
+ uut_runs = client.uut_status(
91
+ token=state.token,
92
+ serial_number="326115020010F2F1",
93
+ start_datetime="2026-02-01 00:00:00",
94
+ stop_datetime="2026-02-06 23:59:00",
95
+ max_results=1000,
96
+ )
84
97
  ```
85
98
 
86
99
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lr-qrm"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "CLI client for interacting with Qestit QRM data from LumenRadio tooling."
9
9
  readme = "src/README.md"
10
10
  requires-python = ">=3.9"
@@ -34,30 +34,43 @@ By default, this stores session details at:
34
34
 
35
35
  ### Commands
36
36
 
37
+ #### Check API health
37
38
 
38
- Get test results for a serial number.
39
+ ```bash
40
+ qrm status
41
+ ```
42
+
43
+ #### Inspect UUT history
39
44
 
40
45
  ```bash
41
- qrm get-test-results P00Y00000001
46
+ qrm uut status 326115020010F2F1 --start "2026-02-01 00:00:00" --stop "2026-02-06 23:59:00"
42
47
  ```
43
48
 
49
+ By default the command uses `1970-01-01 00:00:00` as the start timestamp and "now" as the stop. Pass `--base-url` and `--insecure` to override the stored settings when needed.
44
50
 
45
51
  #### JSON output
46
52
 
47
53
  Most commands support a JSON output mode.
48
54
 
49
-
50
55
  ```bash
51
- $ qrm get-test-results P00Y00000001 --format json
56
+ qrm uut status 326115020010F2F1 --output json
52
57
  ```
53
58
 
54
59
  ## Programmatic use
55
60
 
56
61
  ```python
57
- from qrm import QrmClient, load_config
58
-
59
- client = QrmClient(load_config())
60
- results = client.get_test_results("P00Y00000001")
62
+ from qrm.config import load_login_state
63
+ from qrm.client import QrmClient
64
+
65
+ state = load_login_state()
66
+ client = QrmClient(base_url=str(state.base_url), verify_tls=state.verify_tls)
67
+ uut_runs = client.uut_status(
68
+ token=state.token,
69
+ serial_number="326115020010F2F1",
70
+ start_datetime="2026-02-01 00:00:00",
71
+ stop_datetime="2026-02-06 23:59:00",
72
+ max_results=1000,
73
+ )
61
74
  ```
62
75
 
63
76
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lr-qrm
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: CLI client for interacting with Qestit QRM data from LumenRadio tooling.
5
5
  Author-email: Jonas Estberger <jonas.estberger@lumenradio.com>
6
6
  License: MIT License
@@ -57,30 +57,43 @@ By default, this stores session details at:
57
57
 
58
58
  ### Commands
59
59
 
60
+ #### Check API health
60
61
 
61
- Get test results for a serial number.
62
+ ```bash
63
+ qrm status
64
+ ```
65
+
66
+ #### Inspect UUT history
62
67
 
63
68
  ```bash
64
- qrm get-test-results P00Y00000001
69
+ qrm uut status 326115020010F2F1 --start "2026-02-01 00:00:00" --stop "2026-02-06 23:59:00"
65
70
  ```
66
71
 
72
+ By default the command uses `1970-01-01 00:00:00` as the start timestamp and "now" as the stop. Pass `--base-url` and `--insecure` to override the stored settings when needed.
67
73
 
68
74
  #### JSON output
69
75
 
70
76
  Most commands support a JSON output mode.
71
77
 
72
-
73
78
  ```bash
74
- $ qrm get-test-results P00Y00000001 --format json
79
+ qrm uut status 326115020010F2F1 --output json
75
80
  ```
76
81
 
77
82
  ## Programmatic use
78
83
 
79
84
  ```python
80
- from qrm import QrmClient, load_config
81
-
82
- client = QrmClient(load_config())
83
- results = client.get_test_results("P00Y00000001")
85
+ from qrm.config import load_login_state
86
+ from qrm.client import QrmClient
87
+
88
+ state = load_login_state()
89
+ client = QrmClient(base_url=str(state.base_url), verify_tls=state.verify_tls)
90
+ uut_runs = client.uut_status(
91
+ token=state.token,
92
+ serial_number="326115020010F2F1",
93
+ start_datetime="2026-02-01 00:00:00",
94
+ stop_datetime="2026-02-06 23:59:00",
95
+ max_results=1000,
96
+ )
84
97
  ```
85
98
 
86
99
 
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
6
- from datetime import datetime, timedelta, timezone
6
+ from datetime import datetime, timezone
7
7
  from enum import Enum
8
8
  from pathlib import Path
9
9
  from typing import Any
@@ -36,7 +36,7 @@ UUT_CLI_DATE_FORMATS = [
36
36
  "%Y-%m-%dT%H:%M:%S",
37
37
  "%Y-%m-%dT%H:%M:%S%z",
38
38
  ]
39
- UUT_DEFAULT_WINDOW = timedelta(days=1)
39
+ UUT_DEFAULT_START = datetime(1970, 1, 1, tzinfo=timezone.utc)
40
40
 
41
41
 
42
42
  @app.callback(invoke_without_command=True)
@@ -167,7 +167,7 @@ def uut_status(
167
167
  None,
168
168
  "--start",
169
169
  formats=UUT_CLI_DATE_FORMATS,
170
- help="Filter from this timestamp (UTC). Format: YYYY-MM-DD HH:MM:SS. Default: stop - 1 day.",
170
+ help="Filter from this timestamp (UTC). Format: YYYY-MM-DD HH:MM:SS. Default: 1970-01-01 00:00:00.",
171
171
  ),
172
172
  stop: datetime | None = typer.Option(
173
173
  None,
@@ -279,7 +279,7 @@ def _resolve_uut_window(
279
279
  stop: datetime | None,
280
280
  ) -> tuple[datetime, datetime]:
281
281
  stop_value = stop or datetime.now(timezone.utc)
282
- start_value = start or (stop_value - UUT_DEFAULT_WINDOW)
282
+ start_value = start or UUT_DEFAULT_START
283
283
  return start_value, stop_value
284
284
 
285
285
 
@@ -285,7 +285,7 @@ def test_uut_status_command_supports_json_output(monkeypatch, tmp_path: Path) ->
285
285
 
286
286
 
287
287
  def test_uut_status_defaults_time_window(monkeypatch, tmp_path: Path) -> None:
288
- """Start/stop defaults should cover the last 24 hours ending now."""
288
+ """Start defaults to the epoch while stop defaults to the provided value."""
289
289
 
290
290
  state = LoginState( # type: ignore[call-arg]
291
291
  token="TOKEN123",
@@ -296,7 +296,7 @@ def test_uut_status_defaults_time_window(monkeypatch, tmp_path: Path) -> None:
296
296
  config_path = tmp_path / "login.json"
297
297
  config_path.write_text(state.model_dump_json())
298
298
 
299
- fake_start = datetime(2026, 2, 5, 0, 0, tzinfo=timezone.utc)
299
+ fake_start = datetime(1970, 1, 1, 0, 0, tzinfo=timezone.utc)
300
300
  fake_stop = datetime(2026, 2, 6, 0, 0, tzinfo=timezone.utc)
301
301
 
302
302
  def fake_resolver(start, stop): # noqa: ANN001
@@ -331,11 +331,22 @@ def test_uut_status_defaults_time_window(monkeypatch, tmp_path: Path) -> None:
331
331
 
332
332
  assert result.exit_code == 0
333
333
  assert captured == {
334
- "start": "2026-02-05 00:00:00",
334
+ "start": "1970-01-01 00:00:00",
335
335
  "stop": "2026-02-06 00:00:00",
336
336
  }
337
337
 
338
338
 
339
+ def test_resolve_uut_window_defaults_epoch() -> None:
340
+ """When only stop is provided, start should fall back to the epoch."""
341
+
342
+ stop = datetime(2026, 2, 6, 0, 0, tzinfo=timezone.utc)
343
+
344
+ start, resolved_stop = cli._resolve_uut_window(None, stop)
345
+
346
+ assert start == datetime(1970, 1, 1, 0, 0, tzinfo=timezone.utc)
347
+ assert resolved_stop == stop
348
+
349
+
339
350
  def test_uut_status_handles_empty_payload(monkeypatch, tmp_path: Path) -> None:
340
351
  """An empty list should render the placeholder row."""
341
352
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes