MCPcopy
hub / github.com/borgbackup/borg / test_plaintext

Method test_plaintext

src/borg/testsuite/crypto/key_test.py:118–123  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

116 return self.key_data
117
118 def test_plaintext(self):
119 key = PlaintextKey.create(None, None)
120 chunk = b"foo"
121 id = key.id_hash(chunk)
122 assert bin_to_hex(id) == "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
123 assert chunk == key.decrypt(id, key.encrypt(id, chunk))
124
125 def test_keyfile(self, monkeypatch, keys_dir):
126 monkeypatch.setenv("BORG_PASSPHRASE", "test")

Callers

nothing calls this directly

Calls 5

bin_to_hexFunction · 0.85
createMethod · 0.45
id_hashMethod · 0.45
decryptMethod · 0.45
encryptMethod · 0.45

Tested by

no test coverage detected