Skip to content

Commit

Permalink
Improve readability of one test
Browse files Browse the repository at this point in the history
This format also makes it easier to port this test to other
programming languages.

Change-Id: I613fb0747d550691bbd25d99873299a4d3ee402d
  • Loading branch information
Synss committed Oct 31, 2023
1 parent 31b58ea commit 6dc7f8f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/unit/cmk/utils/test_password_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

import binascii
from pathlib import Path

import pytest
Expand Down Expand Up @@ -133,11 +134,13 @@ def test_pw_store_characterization() -> None:
the key generation, or algorithms used would be detected.
"""
# generated by PasswordStore._obfuscate as of commit 79900beda42310dfea9f5bd704041f4e10936ba8
encrypted = (
b"\x00\x00;\x1c\xed\xb9%&b\x14\x83\xf9\xba\x14\x0f\xbeU\xf4\x99\x16\xaew\xa1\x1a*\xc9;M\xb0"
b"u\x80aq\xa6*\x8a\xed\xd3\xd1\xed\xd6~U\x83\x85\xa9\x8e\xfe\xbe<L\x0c\xa3d\xe5O\xf6\xad/"
b"\xa7\xefH\xa0\xe8\x8e\xd9\x89(>\x96\x04\xe0}\xa8\x93\x01e\x8f\x03p\xd3[\xba\x1a\x8a\xbft"
b"\xbc\x97\x19u"
encrypted = binascii.unhexlify(
b"00003b1cedb92526621483f9ba140fbe"
b"55f49916ae77a11a2ac93b4db0758061"
b"71a62a8aedd3d1edd67e558385a98efe"
b"be3c4c0ca364e54ff6ad2fa7ef48a0e8"
b"8ed989283e9604e07da89301658f0370"
b"d35bba1a8abf74bc971975"
)

assert PasswordStore.decrypt(encrypted) == "Time is an illusion. Lunchtime doubly so."

0 comments on commit 6dc7f8f

Please sign in to comment.