secrets/show: pretty print json

This commit is contained in:
Jörg Thalheim
2024-10-01 12:30:51 +02:00
committed by Mic92
parent 105e6bd86a
commit 5d87bc2435
2 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
import json
import logging
import os
from collections.abc import Iterator
@@ -253,7 +254,7 @@ def test_secrets(
cli.run(["secrets", "key", "generate", "--flake", str(test_flake.path)])
with capture_output as output:
cli.run(["secrets", "key", "show", "--flake", str(test_flake.path)])
key = output.out
key = json.loads(output.out)["key"]
assert key.startswith("age1")
cli.run(
["secrets", "users", "add", "--flake", str(test_flake.path), "testuser", key]