e8b3ecf264495b6e5cf9b5f07889545ed242b64b
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 Support Python 3.10 and PyP...

Marco Ricci authored 3 months ago

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

Marco Ricci authored 4 months ago

tests/test_typing.py                   8) 
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase_typing.py  9) import derivepassphrase.types
Marco Ricci Move typing classes into se...

Marco Ricci authored 4 months ago

tests/test_typing.py                  10) import pytest
tests/test_typing.py                  11) 
tests/test_typing.py                  12) @pytest.mark.parametrize(['obj', 'comment'], [
tests/test_typing.py                  13)     (None, 'not a dict'),
tests/test_typing.py                  14)     ({}, 'missing required keys'),
tests/test_typing.py                  15)     ({'global': None, 'services': {}}, 'bad config value: global'),
tests/test_typing.py                  16)     ({'global': {'key': 123}, 'services': {}},
tests/test_typing.py                  17)      'bad config value: global.key'),
tests/test_typing.py                  18)     ({'global': {'phrase': 'abc', 'key': '...'}, 'services': {}},
tests/test_typing.py                  19)      'incompatible config values: global.key and global.phrase'),
tests/test_typing.py                  20)     ({'services': None}, 'bad config value: services'),
tests/test_typing.py                  21)     ({'services': {2: {}}}, 'bad config value: services."2"'),
tests/test_typing.py                  22)     ({'services': {'2': 2}}, 'bad config value: services."2"'),
tests/test_typing.py                  23)     ({'services': {'sv': {'notes': False}}},
tests/test_typing.py                  24)      'bad config value: services.sv.notes'),
tests/test_typing.py                  25)     ({'services': {'sv': {'notes': 'blah blah blah'}}}, ''),
tests/test_typing.py                  26)     ({'services': {'sv': {'length': '200'}}},
tests/test_typing.py                  27)      'bad config value: services.sv.length'),
tests/test_typing.py                  28)     ({'services': {'sv': {'length': 0.5}}},
tests/test_typing.py                  29)      'bad config value: services.sv.length'),
tests/test_typing.py                  30)     ({'services': {'sv': {'length': -10}}},
tests/test_typing.py                  31)      'bad config value: services.sv.length'),
tests/test_typing.py                  32)     ({'services': {'sv': {'upper': -10}}},
tests/test_typing.py                  33)      'bad config value: services.sv.upper'),
tests/test_typing.py                  34)     ({'global': {'phrase': 'my secret phrase'},
tests/test_typing.py                  35)       'services': {'sv': {'length': 10}}},
tests/test_typing.py                  36)      ''),
tests/test_typing.py                  37)     ({'services': {'sv': {'length': 10, 'phrase': '...'}}}, ''),
tests/test_typing.py                  38)     ({'services': {'sv': {'length': 10, 'key': '...'}}}, ''),
tests/test_typing.py                  39)     ({'services': {'sv': {'upper': 10, 'key': '...'}}}, ''),
tests/test_typing.py                  40)     ({'services': {'sv': {'phrase': 'abc', 'key': '...'}}},
tests/test_typing.py                  41)      'incompatible config values: services.sv.key and services.sv.phrase'),
tests/test_typing.py                  42)     ({'global': {'phrase': 'abc'},
tests/test_typing.py                  43)       'services': {'sv': {'phrase': 'abc', 'length': 10}}}, ''),
tests/test_typing.py                  44)     ({'global': {'key': '...'},
tests/test_typing.py                  45)       'services': {'sv': {'phrase': 'abc', 'length': 10}}}, ''),
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase_typing.py 46)     ({'global': {'key': '...'},
tests/test_derivepassphrase_typing.py 47)       'services': {'sv1': {'phrase': 'abc', 'length': 10, 'upper': 1},
tests/test_derivepassphrase_typing.py 48)                    'sv2': {'length': 10, 'repeat': 1, 'lower': 1}}}, ''),
Marco Ricci Move typing classes into se...

Marco Ricci authored 4 months ago

tests/test_typing.py                  49) ])
tests/test_typing.py                  50) def test_200_is_vault_config(obj: Any, comment: str) -> None:
Marco Ricci Rename and regroup all test...

Marco Ricci authored 4 months ago

tests/test_derivepassphrase_typing.py 51)     is_vault_config = derivepassphrase.types.is_vault_config
tests/test_derivepassphrase_typing.py 52)     assert is_vault_config(obj) == (not comment), (