8c9ca812be07a78de272aad82c08251cbaae5164
Marco Ricci Move typing classes into se...

Marco Ricci authored 4 months ago

tests/test_typing.py                   1) # SPDX-FileCopyrightText: 2024 Marco Ricci <m@the13thletter.info>
tests/test_typing.py                   2) #
tests/test_typing.py                   3) # SPDX-License-Identifier: MIT
tests/test_typing.py                   4) 
tests/test_typing.py                   5) from __future__ import annotations
tests/test_typing.py                   6) 
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_typing.py  7) import pytest
Marco Ricci Support Python 3.10 and PyP...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_typing.py  8) from typing_extensions import Any
Marco Ricci Move typing classes into se...

Marco Ricci authored 4 months ago

tests/test_typing.py                   9) 
Marco Ricci Consolidate `types` submodu...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_types.py  10) from derivepassphrase import _types
Marco Ricci Fix style issues with ruff...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_typing.py 11) 
Marco Ricci Move typing classes into se...

Marco Ricci authored 4 months ago

tests/test_typing.py                  12) 
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_typing.py 13) @pytest.mark.parametrize(
tests/test_derivepassphrase_typing.py 14)     ['obj', 'comment'],
tests/test_derivepassphrase_typing.py 15)     [
tests/test_derivepassphrase_typing.py 16)         (None, 'not a dict'),
tests/test_derivepassphrase_typing.py 17)         ({}, 'missing required keys'),
tests/test_derivepassphrase_typing.py 18)         ({'global': None, 'services': {}}, 'bad config value: global'),
tests/test_derivepassphrase_typing.py 19)         (
tests/test_derivepassphrase_typing.py 20)             {'global': {'key': 123}, 'services': {}},
tests/test_derivepassphrase_typing.py 21)             'bad config value: global.key',
tests/test_derivepassphrase_typing.py 22)         ),
tests/test_derivepassphrase_typing.py 23)         (
tests/test_derivepassphrase_typing.py 24)             {'global': {'phrase': 'abc', 'key': '...'}, 'services': {}},
tests/test_derivepassphrase_typing.py 25)             'incompatible config values: global.key and global.phrase',
tests/test_derivepassphrase_typing.py 26)         ),
tests/test_derivepassphrase_typing.py 27)         ({'services': None}, 'bad config value: services'),
tests/test_derivepassphrase_typing.py 28)         ({'services': {2: {}}}, 'bad config value: services."2"'),
tests/test_derivepassphrase_typing.py 29)         ({'services': {'2': 2}}, 'bad config value: services."2"'),
tests/test_derivepassphrase_typing.py 30)         (
tests/test_derivepassphrase_typing.py 31)             {'services': {'sv': {'notes': False}}},
tests/test_derivepassphrase_typing.py 32)             'bad config value: services.sv.notes',
tests/test_derivepassphrase_typing.py 33)         ),
tests/test_derivepassphrase_typing.py 34)         ({'services': {'sv': {'notes': 'blah blah blah'}}}, ''),
tests/test_derivepassphrase_typing.py 35)         (
tests/test_derivepassphrase_typing.py 36)             {'services': {'sv': {'length': '200'}}},
tests/test_derivepassphrase_typing.py 37)             'bad config value: services.sv.length',
tests/test_derivepassphrase_typing.py 38)         ),
tests/test_derivepassphrase_typing.py 39)         (
tests/test_derivepassphrase_typing.py 40)             {'services': {'sv': {'length': 0.5}}},
tests/test_derivepassphrase_typing.py 41)             'bad config value: services.sv.length',
tests/test_derivepassphrase_typing.py 42)         ),
tests/test_derivepassphrase_typing.py 43)         (
tests/test_derivepassphrase_typing.py 44)             {'services': {'sv': {'length': -10}}},
tests/test_derivepassphrase_typing.py 45)             'bad config value: services.sv.length',
tests/test_derivepassphrase_typing.py 46)         ),
tests/test_derivepassphrase_typing.py 47)         (
tests/test_derivepassphrase_typing.py 48)             {'services': {'sv': {'upper': -10}}},
tests/test_derivepassphrase_typing.py 49)             'bad config value: services.sv.upper',
tests/test_derivepassphrase_typing.py 50)         ),
tests/test_derivepassphrase_typing.py 51)         (
tests/test_derivepassphrase_typing.py 52)             {
tests/test_derivepassphrase_typing.py 53)                 'global': {'phrase': 'my secret phrase'},
tests/test_derivepassphrase_typing.py 54)                 'services': {'sv': {'length': 10}},
tests/test_derivepassphrase_typing.py 55)             },
tests/test_derivepassphrase_typing.py 56)             '',
tests/test_derivepassphrase_typing.py 57)         ),
tests/test_derivepassphrase_typing.py 58)         ({'services': {'sv': {'length': 10, 'phrase': '...'}}}, ''),
tests/test_derivepassphrase_typing.py 59)         ({'services': {'sv': {'length': 10, 'key': '...'}}}, ''),
tests/test_derivepassphrase_typing.py 60)         ({'services': {'sv': {'upper': 10, 'key': '...'}}}, ''),
tests/test_derivepassphrase_typing.py 61)         (
tests/test_derivepassphrase_typing.py 62)             {'services': {'sv': {'phrase': 'abc', 'key': '...'}}},
tests/test_derivepassphrase_typing.py 63)             'incompatible config values: services.sv.key and services.sv.phrase',  # noqa: E501
tests/test_derivepassphrase_typing.py 64)         ),
tests/test_derivepassphrase_typing.py 65)         (
tests/test_derivepassphrase_typing.py 66)             {
tests/test_derivepassphrase_typing.py 67)                 'global': {'phrase': 'abc'},
tests/test_derivepassphrase_typing.py 68)                 'services': {'sv': {'phrase': 'abc', 'length': 10}},
tests/test_derivepassphrase_typing.py 69)             },
tests/test_derivepassphrase_typing.py 70)             '',
tests/test_derivepassphrase_typing.py 71)         ),
tests/test_derivepassphrase_typing.py 72)         (
tests/test_derivepassphrase_typing.py 73)             {
tests/test_derivepassphrase_typing.py 74)                 'global': {'key': '...'},
tests/test_derivepassphrase_typing.py 75)                 'services': {'sv': {'phrase': 'abc', 'length': 10}},
tests/test_derivepassphrase_typing.py 76)             },
tests/test_derivepassphrase_typing.py 77)             '',
tests/test_derivepassphrase_typing.py 78)         ),
tests/test_derivepassphrase_typing.py 79)         (
tests/test_derivepassphrase_typing.py 80)             {
tests/test_derivepassphrase_typing.py 81)                 'global': {'key': '...'},
tests/test_derivepassphrase_typing.py 82)                 'services': {
tests/test_derivepassphrase_typing.py 83)                     'sv1': {'phrase': 'abc', 'length': 10, 'upper': 1},
tests/test_derivepassphrase_typing.py 84)                     'sv2': {'length': 10, 'repeat': 1, 'lower': 1},
tests/test_derivepassphrase_typing.py 85)                 },
tests/test_derivepassphrase_typing.py 86)             },
tests/test_derivepassphrase_typing.py 87)             '',
tests/test_derivepassphrase_typing.py 88)         ),
tests/test_derivepassphrase_typing.py 89)     ],
tests/test_derivepassphrase_typing.py 90) )
Marco Ricci Move typing classes into se...

Marco Ricci authored 4 months ago

tests/test_typing.py                  91) def test_200_is_vault_config(obj: Any, comment: str) -> None:
Marco Ricci Consolidate `types` submodu...

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_types.py  92)     is_vault_config = _types.is_vault_config
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase_typing.py 93)     assert is_vault_config(obj) == (not comment), (
Marco Ricci Reformat everything with ruff

Marco Ricci authored 3 months ago

tests/test_derivepassphrase_typing.py 94)         'failed to complain about: ' + comment
tests/test_derivepassphrase_typing.py 95)         if comment