lr-qrm 0.1.1__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.1
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
@@ -69,7 +69,7 @@ qrm status
69
69
  qrm uut status 326115020010F2F1 --start "2026-02-01 00:00:00" --stop "2026-02-06 23:59:00"
70
70
  ```
71
71
 
72
- By default the command queries the last 24 hours ending now. Pass `--base-url` and `--insecure` to override the stored settings when needed.
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.
73
73
 
74
74
  #### JSON output
75
75
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lr-qrm"
7
- version = "0.1.1"
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"
@@ -46,7 +46,7 @@ qrm status
46
46
  qrm uut status 326115020010F2F1 --start "2026-02-01 00:00:00" --stop "2026-02-06 23:59:00"
47
47
  ```
48
48
 
49
- By default the command queries the last 24 hours ending now. Pass `--base-url` and `--insecure` to override the stored settings when needed.
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.
50
50
 
51
51
  #### JSON output
52
52
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lr-qrm
3
- Version: 0.1.1
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
@@ -69,7 +69,7 @@ qrm status
69
69
  qrm uut status 326115020010F2F1 --start "2026-02-01 00:00:00" --stop "2026-02-06 23:59:00"
70
70
  ```
71
71
 
72
- By default the command queries the last 24 hours ending now. Pass `--base-url` and `--insecure` to override the stored settings when needed.
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.
73
73
 
74
74
  #### JSON output
75
75
 
@@ -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