4701b329098224a8b84ab1826b312bd937de942a
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py   1) # SPDX-FileCopyrightText: 2024 Marco Ricci <m@the13thletter.info>
tests/test_derivepassphrase.py   2) #
tests/test_derivepassphrase.py   3) # SPDX-License-Identifier: MIT
tests/test_derivepassphrase.py   4) 
Marco Ricci Move `sequin` and `ssh_agen...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py   5) """Test passphrase generation via derivepassphrase.vault.Vault."""
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py   6) 
tests/test_derivepassphrase.py   7) from __future__ import annotations
tests/test_derivepassphrase.py   8) 
tests/test_derivepassphrase.py   9) import math
tests/test_derivepassphrase.py  10) from typing import Any
tests/test_derivepassphrase.py  11) 
tests/test_derivepassphrase.py  12) import pytest
tests/test_derivepassphrase.py  13) 
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  14) import derivepassphrase
tests/test_derivepassphrase.py  15) 
Marco Ricci Move `sequin` and `ssh_agen...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  16) Vault = derivepassphrase.vault.Vault
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  17) 
tests/test_derivepassphrase.py  18) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  19) class TestVault:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  20)     phrase = b'She cells C shells bye the sea shoars'
tests/test_derivepassphrase.py  21)     google_phrase = rb': 4TVH#5:aZl8LueOT\{'
tests/test_derivepassphrase.py  22)     twitter_phrase = rb"[ (HN_N:lI&<ro=)3'g9"
tests/test_derivepassphrase.py  23) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  24)     @pytest.mark.parametrize(
tests/test_derivepassphrase.py  25)         ['service', 'expected'],
tests/test_derivepassphrase.py  26)         [
tests/test_derivepassphrase.py  27)             (b'google', google_phrase),
tests/test_derivepassphrase.py  28)             ('twitter', twitter_phrase),
tests/test_derivepassphrase.py  29)         ],
tests/test_derivepassphrase.py  30)     )
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  31)     def test_200_basic_configuration(
tests/test_derivepassphrase.py  32)         self, service: bytes | str, expected: bytes
tests/test_derivepassphrase.py  33)     ) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  34)         assert Vault(phrase=self.phrase).generate(service) == expected
tests/test_derivepassphrase.py  35) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  36)     def test_201_phrase_dependence(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  37)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  38)             Vault(phrase=(self.phrase + b'X')).generate('google')
tests/test_derivepassphrase.py  39)             == b'n+oIz6sL>K*lTEWYRO%7'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  40)         )
tests/test_derivepassphrase.py  41) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  42)     def test_202_reproducibility_and_bytes_service_name(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  43)         assert Vault(phrase=self.phrase).generate(b'google') == Vault(
tests/test_derivepassphrase.py  44)             phrase=self.phrase
tests/test_derivepassphrase.py  45)         ).generate('google')
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  46) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  47)     def test_203_reproducibility_and_bytearray_service_name(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  48)         assert Vault(phrase=self.phrase).generate(b'google') == Vault(
tests/test_derivepassphrase.py  49)             phrase=self.phrase
tests/test_derivepassphrase.py  50)         ).generate(bytearray(b'google'))
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  51) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  52)     def test_210_nonstandard_length(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  53)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  54)             Vault(phrase=self.phrase, length=4).generate('google') == b'xDFu'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  55)         )
tests/test_derivepassphrase.py  56) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  57)     def test_211_repetition_limit(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  58)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  59)             Vault(
tests/test_derivepassphrase.py  60)                 phrase=b'', length=24, symbol=0, number=0, repeat=1
tests/test_derivepassphrase.py  61)             ).generate('asd')
tests/test_derivepassphrase.py  62)             == b'IVTDzACftqopUXqDHPkuCIhV'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  63)         )
tests/test_derivepassphrase.py  64) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  65)     def test_212_without_symbols(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  66)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  67)             Vault(phrase=self.phrase, symbol=0).generate('google')
tests/test_derivepassphrase.py  68)             == b'XZ4wRe0bZCazbljCaMqR'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  69)         )
tests/test_derivepassphrase.py  70) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  71)     def test_213_no_numbers(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  72)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  73)             Vault(phrase=self.phrase, number=0).generate('google')
tests/test_derivepassphrase.py  74)             == b'_*$TVH.%^aZl(LUeOT?>'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  75)         )
tests/test_derivepassphrase.py  76) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  77)     def test_214_no_lowercase_letters(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  78)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  79)             Vault(phrase=self.phrase, lower=0).generate('google')
tests/test_derivepassphrase.py  80)             == b':{?)+7~@OA:L]!0E$)(+'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  81)         )
tests/test_derivepassphrase.py  82) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  83)     def test_215_at_least_5_digits(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  84)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  85)             Vault(phrase=self.phrase, length=8, number=5).generate('songkick')
tests/test_derivepassphrase.py  86)             == b'i0908.7['
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  87)         )
tests/test_derivepassphrase.py  88) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  89)     def test_216_lots_of_spaces(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  90)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  91)             Vault(phrase=self.phrase, space=12).generate('songkick')
tests/test_derivepassphrase.py  92)             == b' c   6 Bq  % 5fR    '
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  93)         )
tests/test_derivepassphrase.py  94) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  95)     def test_217_all_character_classes(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py  96)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py  97)             Vault(
tests/test_derivepassphrase.py  98)                 phrase=self.phrase,
tests/test_derivepassphrase.py  99)                 lower=2,
tests/test_derivepassphrase.py 100)                 upper=2,
tests/test_derivepassphrase.py 101)                 number=1,
tests/test_derivepassphrase.py 102)                 space=3,
tests/test_derivepassphrase.py 103)                 dash=2,
tests/test_derivepassphrase.py 104)                 symbol=1,
tests/test_derivepassphrase.py 105)             ).generate('google')
tests/test_derivepassphrase.py 106)             == b': : fv_wqt>a-4w1S  R'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 107)         )
tests/test_derivepassphrase.py 108) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 109)     def test_218_only_numbers_and_very_high_repetition_limit(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 110)         generated = Vault(
tests/test_derivepassphrase.py 111)             phrase=b'',
tests/test_derivepassphrase.py 112)             length=40,
tests/test_derivepassphrase.py 113)             lower=0,
tests/test_derivepassphrase.py 114)             upper=0,
tests/test_derivepassphrase.py 115)             space=0,
tests/test_derivepassphrase.py 116)             dash=0,
tests/test_derivepassphrase.py 117)             symbol=0,
tests/test_derivepassphrase.py 118)             repeat=4,
tests/test_derivepassphrase.py 119)         ).generate('abcdef')
tests/test_derivepassphrase.py 120)         forbidden_substrings = {
tests/test_derivepassphrase.py 121)             b'0000',
tests/test_derivepassphrase.py 122)             b'1111',
tests/test_derivepassphrase.py 123)             b'2222',
tests/test_derivepassphrase.py 124)             b'3333',
tests/test_derivepassphrase.py 125)             b'4444',
tests/test_derivepassphrase.py 126)             b'5555',
tests/test_derivepassphrase.py 127)             b'6666',
tests/test_derivepassphrase.py 128)             b'7777',
tests/test_derivepassphrase.py 129)             b'8888',
tests/test_derivepassphrase.py 130)             b'9999',
tests/test_derivepassphrase.py 131)         }
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 132)         for substring in forbidden_substrings:
tests/test_derivepassphrase.py 133)             assert substring not in generated
tests/test_derivepassphrase.py 134) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 135)     def test_219_very_limited_character_set(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 136)         generated = Vault(
tests/test_derivepassphrase.py 137)             phrase=b'', length=24, lower=0, upper=0, space=0, symbol=0
tests/test_derivepassphrase.py 138)         ).generate('testing')
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 139)         assert generated == b'763252593304946694588866'
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 140) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 141)     def test_220_character_set_subtraction(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 142)         assert Vault._subtract(b'be', b'abcdef') == bytearray(b'acdf')
tests/test_derivepassphrase.py 143) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 144)     @pytest.mark.parametrize(
tests/test_derivepassphrase.py 145)         ['length', 'settings', 'entropy'],
tests/test_derivepassphrase.py 146)         [
tests/test_derivepassphrase.py 147)             (20, {}, math.log2(math.factorial(20)) + 20 * math.log2(94)),
tests/test_derivepassphrase.py 148)             (
tests/test_derivepassphrase.py 149)                 20,
tests/test_derivepassphrase.py 150)                 {'upper': 0, 'number': 0, 'space': 0, 'symbol': 0},
tests/test_derivepassphrase.py 151)                 math.log2(math.factorial(20)) + 20 * math.log2(26),
tests/test_derivepassphrase.py 152)             ),
tests/test_derivepassphrase.py 153)             (0, {}, float('-inf')),
tests/test_derivepassphrase.py 154)             (
tests/test_derivepassphrase.py 155)                 0,
tests/test_derivepassphrase.py 156)                 {'lower': 0, 'number': 0, 'space': 0, 'symbol': 0},
tests/test_derivepassphrase.py 157)                 float('-inf'),
tests/test_derivepassphrase.py 158)             ),
tests/test_derivepassphrase.py 159)             (1, {}, math.log2(94)),
tests/test_derivepassphrase.py 160)             (1, {'upper': 0, 'lower': 0, 'number': 0, 'symbol': 0}, 0.0),
tests/test_derivepassphrase.py 161)         ],
tests/test_derivepassphrase.py 162)     )
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 163)     def test_221_entropy(
tests/test_derivepassphrase.py 164)         self, length: int, settings: dict[str, int], entropy: int
tests/test_derivepassphrase.py 165)     ) -> None:
tests/test_derivepassphrase.py 166)         v = Vault(length=length, **settings)  # type: ignore[arg-type]
tests/test_derivepassphrase.py 167)         assert math.isclose(v._entropy(), entropy)
tests/test_derivepassphrase.py 168)         assert v._estimate_sufficient_hash_length() > 0
tests/test_derivepassphrase.py 169)         if math.isfinite(entropy) and entropy:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 170)             assert v._estimate_sufficient_hash_length(1.0) == math.ceil(
tests/test_derivepassphrase.py 171)                 entropy / 8
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 172)             )
tests/test_derivepassphrase.py 173)         assert v._estimate_sufficient_hash_length(8.0) >= entropy
tests/test_derivepassphrase.py 174) 
tests/test_derivepassphrase.py 175)     def test_222_hash_length_estimation(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 176)         v = Vault(
tests/test_derivepassphrase.py 177)             phrase=self.phrase,
tests/test_derivepassphrase.py 178)             lower=0,
tests/test_derivepassphrase.py 179)             upper=0,
tests/test_derivepassphrase.py 180)             number=0,
tests/test_derivepassphrase.py 181)             symbol=0,
tests/test_derivepassphrase.py 182)             space=1,
tests/test_derivepassphrase.py 183)             length=1,
tests/test_derivepassphrase.py 184)         )
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 185)         assert v._entropy() == 0.0
tests/test_derivepassphrase.py 186)         assert v._estimate_sufficient_hash_length() > 0
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 187) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 188)     @pytest.mark.parametrize(
tests/test_derivepassphrase.py 189)         ['service', 'expected'],
tests/test_derivepassphrase.py 190)         [
tests/test_derivepassphrase.py 191)             (b'google', google_phrase),
tests/test_derivepassphrase.py 192)             ('twitter', twitter_phrase),
tests/test_derivepassphrase.py 193)         ],
tests/test_derivepassphrase.py 194)     )
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 195)     def test_223_hash_length_expansion(
tests/test_derivepassphrase.py 196)         self, monkeypatch: Any, service: str | bytes, expected: bytes
tests/test_derivepassphrase.py 197)     ) -> None:
tests/test_derivepassphrase.py 198)         v = Vault(phrase=self.phrase)
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 199)         monkeypatch.setattr(
tests/test_derivepassphrase.py 200)             v,
tests/test_derivepassphrase.py 201)             '_estimate_sufficient_hash_length',
tests/test_derivepassphrase.py 202)             lambda *args, **kwargs: 1,  # noqa: ARG005
tests/test_derivepassphrase.py 203)         )
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 204)         assert v._estimate_sufficient_hash_length() < len(self.phrase)
tests/test_derivepassphrase.py 205)         assert v.generate(service) == expected
tests/test_derivepassphrase.py 206) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 207)     @pytest.mark.parametrize(
Marco Ricci Allow all textual strings,...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase.py 208)         's',
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 209)         [
Marco Ricci Allow all textual strings,...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase.py 210)             'ñ',
tests/test_derivepassphrase.py 211)             'Düsseldorf',
tests/test_derivepassphrase.py 212)             'liberté, egalité, fraternité',
tests/test_derivepassphrase.py 213)             'ASCII',
tests/test_derivepassphrase.py 214)             b'D\xc3\xbcsseldorf',
tests/test_derivepassphrase.py 215)             bytearray([2, 3, 5, 7, 11, 13]),
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 216)         ],
tests/test_derivepassphrase.py 217)     )
Marco Ricci Allow all textual strings,...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase.py 218)     def test_224_binary_strings(self, s: str | bytes | bytearray) -> None:
Marco Ricci Move `sequin` and `ssh_agen...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 219)         binstr = Vault._get_binary_string
Marco Ricci Allow all textual strings,...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase.py 220)         if isinstance(s, str):
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 221)             assert binstr(s) == s.encode('UTF-8')
tests/test_derivepassphrase.py 222)             assert binstr(binstr(s)) == s.encode('UTF-8')
tests/test_derivepassphrase.py 223)         else:
tests/test_derivepassphrase.py 224)             assert binstr(s) == bytes(s)
tests/test_derivepassphrase.py 225)             assert binstr(binstr(s)) == bytes(s)
tests/test_derivepassphrase.py 226) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 227)     def test_310_too_many_symbols(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 228)         with pytest.raises(
tests/test_derivepassphrase.py 229)             ValueError, match='requested passphrase length too short'
tests/test_derivepassphrase.py 230)         ):
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 231)             Vault(phrase=self.phrase, symbol=100)
tests/test_derivepassphrase.py 232) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 233)     def test_311_no_viable_characters(self) -> None:
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 234)         with pytest.raises(ValueError, match='no allowed characters left'):
tests/test_derivepassphrase.py 235)             Vault(
tests/test_derivepassphrase.py 236)                 phrase=self.phrase,
tests/test_derivepassphrase.py 237)                 lower=0,
tests/test_derivepassphrase.py 238)                 upper=0,
tests/test_derivepassphrase.py 239)                 number=0,
tests/test_derivepassphrase.py 240)                 space=0,
tests/test_derivepassphrase.py 241)                 dash=0,
tests/test_derivepassphrase.py 242)                 symbol=0,
tests/test_derivepassphrase.py 243)             )
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 244) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 245)     def test_320_character_set_subtraction_duplicate(self) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 246)         with pytest.raises(ValueError, match='duplicate characters'):
tests/test_derivepassphrase.py 247)             Vault._subtract(b'abcdef', b'aabbccddeeff')
tests/test_derivepassphrase.py 248)         with pytest.raises(ValueError, match='duplicate characters'):
tests/test_derivepassphrase.py 249)             Vault._subtract(b'aabbccddeeff', b'abcdef')
tests/test_derivepassphrase.py 250) 
tests/test_derivepassphrase.py 251)     def test_322_hash_length_estimation(self) -> None:
tests/test_derivepassphrase.py 252)         v = Vault(phrase=self.phrase)
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 253)         with pytest.raises(ValueError, match='invalid safety factor'):
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py 254)             assert v._estimate_sufficient_hash_length(-1.0)
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py 255)         with pytest.raises(
tests/test_derivepassphrase.py 256)             TypeError, match='invalid safety factor: not a float'
tests/test_derivepassphrase.py 257)         ):