diff options
Diffstat (limited to 'tests/conftest.py')
| -rw-r--r-- | tests/conftest.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..1f70259 --- /dev/null +++ b/tests/conftest.py | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | # etoolkit | ||
| 2 | # Copyright (C) 2021 Simeon Simeonov | ||
| 3 | |||
| 4 | # This program is free software: you can redistribute it and/or modify | ||
| 5 | # it under the terms of the GNU General Public License as published by | ||
| 6 | # the Free Software Foundation, either version 3 of the License, or | ||
| 7 | # (at your option) any later version. | ||
| 8 | |||
| 9 | # This program is distributed in the hope that it will be useful, | ||
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | # GNU General Public License for more details. | ||
| 13 | |||
| 14 | # You should have received a copy of the GNU General Public License | ||
| 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | """Common fixtures""" | ||
| 17 | import pytest | ||
| 18 | |||
| 19 | |||
| 20 | @pytest.fixture | ||
| 21 | def config_data(): | ||
| 22 | """config_data for testing""" | ||
| 23 | return { | ||
| 24 | 'general': { | ||
| 25 | 'MASTER_PASSWORD_HASH': ( | ||
| 26 | 'pbkdf2_sha256$100000$kFOQkAPtStZ/Ny/O4501ygHGQnqh5Y+ySxF9qVHr' | ||
| 27 | 'iv8=$3BujuWzn3CfDnw4yiD9m3F+GjeW1MHHW40R/ThHNcn0=' | ||
| 28 | ) | ||
| 29 | }, | ||
| 30 | 'instances': { | ||
| 31 | 'default': {'ETOOLKIT_PROMPT': '(%i)'}, | ||
| 32 | 'dev': { | ||
| 33 | 'ETOOLKIT_PARENT': 'default', | ||
| 34 | 'PYTHONPATH': ':/home/user/.pythonpath', | ||
| 35 | 'DB_CONNECTION': ( | ||
| 36 | 'enc-val$1$Y/TBb1F3siHTw6qZg9ERzZfA8PLPf2CwGSQLpu9jYWw=$FT' | ||
| 37 | '5tS9o+ABvsxogIXpJim16Gz5SVtV8=' | ||
| 38 | ), | ||
| 39 | }, | ||
| 40 | 'secret': { | ||
| 41 | 'ETOOLKIT_PARENT': 'default', | ||
| 42 | 'ETOOLKIT_SENSITIVE': ['PASSWORD'], | ||
| 43 | 'GNUPGHOME': '%h/private/.gnupg', | ||
| 44 | 'PASSWORD': ( | ||
| 45 | 'enc-val$1$vIBcoCNiYrsDLtF41uLuSEnppBjhliD0B8jwcBJcj/c=$Kw' | ||
| 46 | 'OGe/y1dlxktDaCnJPIVNuaQ4Q7yNo=' | ||
| 47 | ), | ||
| 48 | }, | ||
| 49 | }, | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | @pytest.fixture | ||
| 54 | def password_hash(): | ||
| 55 | """password hash for testing, corresponding to 'the very secret passwd'""" | ||
| 56 | return ( | ||
| 57 | 'pbkdf2_sha256$100000$kFOQkAPtStZ/Ny/O4501ygHGQnqh5Y+ySxF9qVHr' | ||
| 58 | 'iv8=$3BujuWzn3CfDnw4yiD9m3F+GjeW1MHHW40R/ThHNcn0=' | ||
| 59 | ) | ||
