e8f3ec854c425cc36565a40adbf00d22a2febeec
Marco Ricci Change the author e-mail ad...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase_vault.py   1) # SPDX-FileCopyrightText: 2024 Marco Ricci <software@the13thletter.info>
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

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) 
tests/test_derivepassphrase.py        11) import pytest
tests/test_derivepassphrase.py        12) 
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        41)     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        42)         assert Vault(phrase=self.phrase).generate(b'google') == Vault(
tests/test_derivepassphrase.py        43)             phrase=self.phrase
tests/test_derivepassphrase.py        44)         ).generate('google')
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        46)     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        47)         assert Vault(phrase=self.phrase).generate(b'google') == Vault(
tests/test_derivepassphrase.py        48)             phrase=self.phrase
tests/test_derivepassphrase.py        49)         ).generate(bytearray(b'google'))
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        53)             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        54)         )
tests/test_derivepassphrase.py        55) 
Marco Ricci Fix typing issues in mypy s...

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        76)     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        77)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        82)     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        83)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        88)     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        89)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py        94)     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        95)         assert (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py       134)     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       135)         generated = Vault(
tests/test_derivepassphrase.py       136)             phrase=b'', length=24, lower=0, upper=0, space=0, symbol=0
tests/test_derivepassphrase.py       137)         ).generate('testing')
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py       140)     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       141)         assert Vault._subtract(b'be', b'abcdef') == bytearray(b'acdf')
tests/test_derivepassphrase.py       142) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py       194)     def test_223_hash_length_expansion(
Marco Ricci Clean up testing machinery...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase_vault.py 195)         self,
tests/test_derivepassphrase_vault.py 196)         monkeypatch: pytest.MonkeyPatch,
tests/test_derivepassphrase_vault.py 197)         service: str | bytes,
tests/test_derivepassphrase_vault.py 198)         expected: bytes,
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase.py       199)     ) -> None:
tests/test_derivepassphrase.py       200)         v = Vault(phrase=self.phrase)
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 2 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 2 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py       218)         ],
tests/test_derivepassphrase.py       219)     )
Marco Ricci Allow all textual strings,...

Marco Ricci authored 2 months ago

tests/test_derivepassphrase.py       220)     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       221)         binstr = Vault._get_binary_string
Marco Ricci Allow all textual strings,...

Marco Ricci authored 2 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

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

Marco Ricci authored 3 months ago

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

Marco Ricci authored 3 months ago

tests/test_derivepassphrase.py       255)         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       256)             assert v._estimate_sufficient_hash_length(-1.0)
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

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