mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-07-04 13:23:13 +02:00
refactor(linux_configuration): move remaining dirs + scripts/ to meta/
- Move fresh-install/ → scripts/single_use/fresh-install/ - Move hosts/ → scripts/periodic_background/hosts/ - Move i3-configuration/ → scripts/periodic_background/i3-configuration/ - Delete linux_configuration/LaTeX/, nix-poc/, report/ (dead dirs) - Move repo-root scripts/ → meta/scripts/ - Update root .pre-commit-config.yaml: scripts/ → meta/scripts/ (9 entries) - Update run.sh ARTIFACT_INIT_SCRIPT to meta/scripts/ - Update fresh-install/main.sh: hosts/install.sh + i3-configuration/install.sh paths - Update check_python_location.sh: add meta/scripts/ to exception list - Fix midnight flakiness in test_recent_workout_returns_true: use timezone-aware local noon instead of now-1h to avoid SQL date() boundary issues
This commit is contained in:
parent
5aefaf7e45
commit
95fdb5a440
@ -3,6 +3,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
import json
|
||||
import sqlite3
|
||||
import subprocess
|
||||
@ -779,10 +780,17 @@ class TestIsWorkoutFinishRecent:
|
||||
"CREATE TABLE workouts "
|
||||
"(id TEXT PRIMARY KEY, start INTEGER, finish INTEGER)",
|
||||
)
|
||||
now_ms = int(time.time() * 1000)
|
||||
# Anchor to local noon to avoid midnight boundary issues: the SQL
|
||||
# date() filter requires start and now to share the same local date.
|
||||
local_noon = (
|
||||
datetime.datetime.now(tz=datetime.timezone.utc)
|
||||
.astimezone()
|
||||
.replace(hour=12, minute=0, second=0, microsecond=0)
|
||||
)
|
||||
local_noon_ms = int(local_noon.timestamp() * 1000)
|
||||
conn.execute(
|
||||
"INSERT INTO workouts VALUES (?, ?, ?)",
|
||||
("w1", now_ms - 3600000, now_ms),
|
||||
("w1", local_noon_ms, local_noon_ms + 3_600_000),
|
||||
)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user