Compare commits

..

No commits in common. "0.1.0a4" and "main" have entirely different histories.

31 changed files with 0 additions and 830 deletions

View file

@ -1,23 +0,0 @@
## 0.1.0a4 (2025-02-13)
### Fix
- structural version
## 0.1.0a2 (2025-02-13)
### Fix
- separate user-data and structural
## 0.1.0a1 (2025-02-12)
### Fix
- many improvment
## 0.1.0a0 (2025-02-05)
### Feat
- first version

View file

@ -1,98 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2025-02-12 15:36+0100\n"
"PO-Revision-Date: 2025-02-12 15:39+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.5\n"
#: src/rougail/user_data_bitwarden/annotator.py:46
msgid ""
"only \"unix_user\" or \"secret\" variable type can have \"bitwarden\" "
"attribute, but \"{0}\" has type \"{1}\""
msgstr ""
"seule une variable de type \"unix_user\" ou \"secret\" peuvent avoir "
"l'attribut \"bitwarden\", mais \"{0}\" a le type \"{1}\""
#: src/rougail/user_data_bitwarden/annotator.py:49
msgid ""
"the variable \"{0}\" has attribute \"bitwarden\" but is a multi variable"
msgstr ""
"la variable \"{0}\" a un attribut \"bitwarden\" mais est une variable "
"multiple"
#: src/rougail/user_data_bitwarden/annotator.py:58
msgid ""
"the variable \"{0}\" is a follower and leader variable (\"{1}\") is also in "
"Bitwarden so this variable could not have default value"
msgstr ""
"la variable \"{0}\" est une suiveuse et la variable leader (\"{1}\") est "
"aussi dans Bitwarden donc cette variable ne peut avoir de valeur par défaut"
#: src/rougail/user_data_bitwarden/annotator.py:62
msgid "the variable \"{0}\" is in Bitwarden so should have default value"
msgstr ""
"la variable \"{0}\" est dans Bitwarden donc doit avoir une valeur par défaut"
#: src/rougail/user_data_bitwarden/data.py:51
msgid "\"bitwarden\" is not set in step.user_data"
msgstr "\"bitwarden\" n'est pas dans step.user_data"
#: src/rougail/user_data_bitwarden/data.py:70
msgid ""
"the value for \"{0}\" at index {1} is already set while it should be filled "
"in by Bitwarden"
msgstr ""
"la valeur de \"{0}\" à l'index {1} est déjà renseigné alors que celle doit "
"devrait être renseigné par Bitwarden"
#: src/rougail/user_data_bitwarden/data.py:72
msgid ""
"the value for \"{0}\" is already set while it should be filled in by "
"Bitwarden"
msgstr ""
"la valeur de \"{0}\" est déjà renseigné alors que celle doit devrait être "
"renseigné par Bitwarden"
#: src/rougail/user_data_bitwarden/data.py:101
msgid "the default value for \"{0}\" must be the Bitwarden item name"
msgstr ""
"la valeur par défaut pour \"{0}\" doit être un nom d'élément de Bitwarden"
#: src/rougail/user_data_bitwarden/data.py:110
msgid "cannot execute the \"bw\" commandline from Bitwarden for \"{0}\": {1}"
msgstr ""
"ne peut exécuter la ligne de commande \"bw\" pour Bitwarden pour \"{0}\": {1}"
#: src/rougail/user_data_bitwarden/data.py:115
msgid "cannot get {0} \"{1}\" from Bitwarden for \"{2}\": {3} ({4})"
msgstr "ne peut récupérer {0} \"{1}\" pour Bitwarden pour \"{2}\": {3} ({4})"
#: src/rougail/user_data_bitwarden/data.py:120
msgid "cannot load {0} \"{1}\" from Bitwarden for \"{2}\": {3}"
msgstr "ne peut charger {0} \"{1}\" pour Bitwarden pour \"{2}\": {3}"
#: src/rougail/user_data_bitwarden/data.py:123
msgid "cannot find {0} \"{1}\" from Bitwarden for \"{2}\""
msgstr "ne peut trouver {0} \"{1}\" pour Bitwarden pour \"{2}\""
#: src/rougail/user_data_bitwarden/data.py:130
msgid ""
"several items found with name \"{0}\" from Bitwarden for \"{1}\": \"{2}\""
msgstr ""
"plusieurs éléments trouvés avec le nom \"{0}\" pour Bitwarden pour \"{1}\": "
"\"{2}\""
#: src/rougail/user_data_bitwarden/data.py:140
msgid "unexpected datas \"{0}\" from Bitwarden for \"{1}\": {2}"
msgstr "données inattendues \"{0}\" pour Bitwarden pour \"{1}\": {2}"

View file

@ -1,73 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-02-12 15:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: src/rougail/user_data_bitwarden/annotator.py:46
msgid "only \"unix_user\" or \"secret\" variable type can have \"bitwarden\" attribute, but \"{0}\" has type \"{1}\""
msgstr ""
#: src/rougail/user_data_bitwarden/annotator.py:49
msgid "the variable \"{0}\" has attribute \"bitwarden\" but is a multi variable"
msgstr ""
#: src/rougail/user_data_bitwarden/annotator.py:58
msgid "the variable \"{0}\" is a follower and leader variable (\"{1}\") is also in Bitwarden so this variable could not have default value"
msgstr ""
#: src/rougail/user_data_bitwarden/annotator.py:62
msgid "the variable \"{0}\" is in Bitwarden so should have default value"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:51
msgid "\"bitwarden\" is not set in step.user_data"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:70
msgid "the value for \"{0}\" at index {1} is already set while it should be filled in by Bitwarden"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:72
msgid "the value for \"{0}\" is already set while it should be filled in by Bitwarden"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:101
msgid "the default value for \"{0}\" must be the Bitwarden item name"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:110
msgid "cannot execute the \"bw\" commandline from Bitwarden for \"{0}\": {1}"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:115
msgid "cannot get {0} \"{1}\" from Bitwarden for \"{2}\": {3} ({4})"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:120
msgid "cannot load {0} \"{1}\" from Bitwarden for \"{2}\": {3}"
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:123
msgid "cannot find {0} \"{1}\" from Bitwarden for \"{2}\""
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:130
msgid "several items found with name \"{0}\" from Bitwarden for \"{1}\": \"{2}\""
msgstr ""
#: src/rougail/user_data_bitwarden/data.py:140
msgid "unexpected datas \"{0}\" from Bitwarden for \"{1}\": {2}"
msgstr ""

View file

@ -1,41 +0,0 @@
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail.user_data_bitwarden"
version = "0.1.0a4"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "Rougail user_data Bitwarden"
requires-python = ">=3.8"
license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Natural Language :: English",
"Natural Language :: French",
]
dependencies = [
"rougail >= 1.1,<2",
"rougail-structural-bitwarden == 0.1.0a0",
]
[project.urls]
Home = "https://forge.cloud.silique.fr/stove/rougail-user-data-bitwarden"
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "pep621"
update_changelog_on_bump = true
changelog_merge_prerelease = true

View file

@ -1,24 +0,0 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from .data import RougailUserDataBitwarden
RougailUserData = RougailUserDataBitwarden
__all__ = ('RougailUserDataBitwarden',)

View file

@ -1,64 +0,0 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from rougail.error import DictConsistencyError
from rougail.annotator.variable import Walk
from .i18n import _
class Annotator(Walk):
"""Annotate for bitwarden"""
level = 95
def __init__(
self,
objectspace,
*args, # pylint: disable=unused-argument
) -> None:
if not objectspace.paths:
return
self.objectspace = objectspace
self.check_variable()
def check_variable(self):
for variable in self.get_variables():
if not variable.bitwarden:
continue
if variable.type not in ["unix_user", "secret"]:
msg = _('only "unix_user" or "secret" variable type can have "bitwarden" attribute, but "{0}" has type "{1}"')
raise DictConsistencyError(msg.format(variable.path, variable.type), 301, variable.xmlfiles)
if variable.multi and variable.path not in self.objectspace.leaders:
msg = _('the variable "{0}" has attribute "bitwarden" but is a multi variable')
raise DictConsistencyError(msg.format(variable.path), 302, variable.xmlfiles)
check_default_value = True
if variable.path in self.objectspace.followers:
leadership = variable.path.rsplit('.', 1)[0]
leader_path = self.objectspace.parents[leadership][0]
leader = self.objectspace.paths[leader_path]
if leader.bitwarden:
if variable.default:
msg = _('the variable "{0}" is a follower and leader variable ("{1}") is also in Bitwarden so this variable could not have default value')
raise DictConsistencyError(msg.format(variable.path, leader_path), 303, variable.xmlfiles)
check_default_value = False
if check_default_value and not variable.default:
msg = _('the variable "{0}" is in Bitwarden so should have default value')
raise DictConsistencyError(msg.format(variable.path), 304, variable.xmlfiles)
self.objectspace.informations.add(variable.path, "bitwarden", True)

View file

@ -1,49 +0,0 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
def get_rougail_config(*,
backward_compatibility=True,
) -> dict:
options = """
step:
structural:
redefine: true
default:
jinja: |-
{% if step.user_data == ['bitwarden'] %}
bitwarden
{% endif %}
{% if step.user_data == ['risotto'] %}
risotto
{% else %}
directory
{% endif %}
"""
return {'name': 'bitwarden',
'process': 'user data',
"options": options,
'level': 90,
}
__all__ = ('get_rougail_config',)

View file

@ -1,141 +0,0 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from subprocess import run
from json import loads
from os import environ
from rougail.error import ExtentionError
from .i18n import _
class RougailUserDataBitwarden:
force_apply_user_data = True
def __init__(self,
config: 'Config',
*,
rougailconfig: "RougailConfig"=None,
):
# this is the tiramisu config object
self.config = config
if rougailconfig is None:
from rougail.config import RougailConfig
rougailconfig = RougailConfig
user_data = rougailconfig['step.user_data']
if 'bitwarden' not in user_data:
user_data.append('bitwarden')
rougailconfig['step.user_data'] = user_data
user_data = rougailconfig['step.user_data']
self.rougailconfig = rougailconfig
if 'bitwarden' not in user_data:
raise ExtentionError(_('"bitwarden" is not set in step.user_data'))
self.errors = []
self.warnings = []
self.leader_informations = {}
def run(self):
self.set_passwords(self.config)
return {'errors': self.errors,
'warnings': self.warnings,
}
def set_passwords(self, optiondescription):
for option in optiondescription:
if option.isoptiondescription():
self.set_passwords(option)
elif option.information.get('bitwarden', False):
path = option.path()
if not option.owner.isdefault():
if option.isfollower():
self.errors.append(_('the value for "{0}" at index {1} is already set while it should be filled in by Bitwarden').format(path, option.index()))
else:
self.errors.append(_('the value for "{0}" is already set while it should be filled in by Bitwarden').format(path))
continue
type_ = option.information.get('type')
if option.isleader():
leader_values = []
self.leader_informations[path] = []
for val in option.value.get():
names, values = self.get_values(path, type_, val, allow_multiple=True)
print(names, values)
if isinstance(values, list):
leader_values.extend(values)
self.leader_informations[path].extend(names)
else:
leader_values.append(values)
self.leader_informations[path].append(names)
option.value.set(leader_values)
else:
if option.isfollower():
leader_path = optiondescription.leader().path()
if leader_path in self.leader_informations:
key_bitwarden = self.leader_informations[leader_path][option.index()]
else:
key_bitwarden = option.value.get()
else:
key_bitwarden = option.value.get()
option.value.set(self.get_values(path, type_, key_bitwarden)[1])
def get_values(self, path, type_, key_bitwarden, *, allow_multiple=False):
if not isinstance(key_bitwarden, str):
self.errors.append(_('the default value for "{0}" must be the Bitwarden item name').format(path))
return None, None
if 'ROUGAIL_BITWARDEN_MOCK_ENABLE' in environ:
if type_ == 'secret':
return 'Ex4mpL3_P4ssw0rD'
return 'example_login'
try:
cpe = run(["bw", "list", "items", "--search", key_bitwarden, '--nointeraction'], capture_output=True)
except Exception as exc:
self.errors.append(_('cannot execute the "bw" commandline from Bitwarden for "{0}": {1}').format(path, exc))
return None, None
out = cpe.stdout.decode('utf8')
err = cpe.stderr.decode('utf8')
if cpe.returncode != 0 or err:
self.errors.append(_('cannot get {0} "{1}" from Bitwarden for "{2}": {3} ({4})').format(type_, key_bitwarden, path, err, cpe.returncode))
return None, None
try:
data = loads(out)
except Exception as exc:
self.errors.append(_('cannot load {0} "{1}" from Bitwarden for "{2}": {3}').format(type_, key_bitwarden, path, exc))
return None, None
if not data:
self.errors.append(_('cannot find {0} "{1}" from Bitwarden for "{2}"').format(type_, key_bitwarden, path))
return None, None
if len(data) != 1:
names = [d["name"] for d in data]
if allow_multiple:
ret = []
return names, [self.get_value(key_bitwarden, path, type_, d) for d in data]
self.errors.append(_('several items found with name "{0}" from Bitwarden for "{1}": "{2}"').format(key_bitwarden, path, "\", \"".join(names)))
return None, None
return data[0]['name'], self.get_value(key_bitwarden, path, type_, data[0])
def get_value(self, key_bitwarden: str, path: str, type_: str, data: dict) -> str:
try:
if type_ == 'secret':
return data['login']['password']
return data['login']['username']
except Exception as exc:
self.errors.append(_('unexpected datas "{0}" from Bitwarden for "{1}": {2}').format(key_bitwarden, path, exc))
return None

View file

@ -1,26 +0,0 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from gettext import translation
from pathlib import Path
t = translation(
"rougail_user_data_bitwarden", str(Path(__file__).parent / "locale"), fallback=True
)
_ = t.gettext

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,3 +0,0 @@
{
"rougail.secret": "bitwarden_password"
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,4 +0,0 @@
{
"rougail.username": "bitwarden_username",
"rougail.secret": "bitwarden_password"
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,12 +0,0 @@
{
"rougail.leader.username": [
{
"rougail.leader.username": "bitwarden_username",
"rougail.leader.secret": "bitwarden_password"
},
{
"rougail.leader.username": "bitwarden_username_2",
"rougail.leader.secret": "bitwarden_password_2"
}
]
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,12 +0,0 @@
{
"rougail.leader.username": [
{
"rougail.leader.username": "test_multi_username1",
"rougail.leader.secret": "test_multi_password1"
},
{
"rougail.leader.username": "test_multi_username2",
"rougail.leader.secret": "test_multi_password2"
}
]
}

View file

@ -1,6 +0,0 @@
{
"errors": [
"several items found with name \"test_secret_\" from Bitwarden for \"rougail.secret\": \"test_secret_1\", \"test_secret_2\""
],
"warnings": []
}

View file

@ -1,3 +0,0 @@
{
"rougail.secret": null
}

View file

@ -1,8 +0,0 @@
---
version: 1.1
secret:
description: the second variable
type: secret
default: test_secret_1
bitwarden: true

View file

@ -1,14 +0,0 @@
---
version: 1.1
username:
description: the username
type: unix_user
default: test_secret_1
bitwarden: true
secret:
description: the secret
type: secret
default: test_secret_1
bitwarden: true

View file

@ -1,18 +0,0 @@
---
version: 1.1
leader:
type: leadership
username:
description: the username
type: unix_user
default:
- test_secret_1
- test_secret_2
bitwarden: true
secret:
description: the secret
type: secret
bitwarden: true

View file

@ -1,17 +0,0 @@
---
version: 1.1
leader:
type: leadership
username:
description: the username
type: unix_user
default:
- test_multi_
bitwarden: true
secret:
description: the secret
type: secret
bitwarden: true

View file

@ -1,8 +0,0 @@
---
version: 1.1
secret:
description: the second variable
type: secret
default: test_secret_
bitwarden: true

View file

@ -1,7 +0,0 @@
---
version: 1.1
secret2:
description: the variable
type: secret
bitwarden: true

View file

@ -1,15 +0,0 @@
---
version: 1.1
leader:
type: leadership
username:
description: the username
type: unix_user
bitwarden: true
secret:
description: the secret
type: secret
bitwarden: true

View file

@ -1,23 +0,0 @@
---
version: 1.1
leader:
type: leadership
username:
description: the username
type: unix_user
default:
- test_secret_1
- test_secret_2
bitwarden: true
secret:
description: the secret
type: secret
default:
jinja: test_secret_{{ index + 1 }}
params:
index:
type: index
bitwarden: true

View file

@ -1,9 +0,0 @@
---
version: 1.1
secret:
description: the secret variable
type: secret
default:
- test_secret_1
bitwarden: true

View file

@ -1,6 +0,0 @@
---
version: 1.1
secret:
description: the first variable
bitwarden: true

View file

@ -1,110 +0,0 @@
import os
from pathlib import Path
from rougail import Rougail, RougailConfig
from rougail.error import DictConsistencyError
#########################
from rougail.user_data_bitwarden import RougailUserDataBitwarden as RougailUserData
from json import load, dump
#########################
from pytest import raises
from rougail_tests.utils import config_to_dict
test_dir = Path(__file__).parent / 'structures'
def _test_dictionaries(test_dir):
rougailconfig = RougailConfig.copy()
rougailconfig['main_dictionaries'] = [str(test_dir)]
# rougailconfig['tiramisu_cache'] = "cache.py"
rougailconfig['step.user_data'] = ['bitwarden']
rougail = Rougail(rougailconfig)
config = rougail.run()
# loads variables in the tiramisu config
errors = RougailUserData(config, rougailconfig=rougailconfig).run()
#expected output
config_dict = dict(config_to_dict(config.value.get()))
ok_file = Path('tests') / 'results' / test_dir.name / 'makedict' / 'bitwarden.json'
if not ok_file.is_file():
ok_file.parent.mkdir(parents=True, exist_ok=True)
with open(ok_file, 'a') as json_file:
dump(config_dict, json_file, indent=4)
with open(ok_file) as json_file:
expected = load(json_file)
errors_file = Path('tests') / 'results' / test_dir.name / 'errors' / 'bitwarden.json'
if not errors_file.is_file():
errors_file.parent.mkdir(parents=True, exist_ok=True)
with open(errors_file, 'a') as json_file:
dump(errors, json_file, indent=4)
with open(errors_file) as json_file:
expected_errors = load(json_file)
# expected_errors = {
# 'errors': [],
# 'warnings': [],
# }
assert expected_errors == errors
#
config.property.read_only()
assert expected == config_dict
def test_dictionaries_1_secret():
"tests the output"
_test_dictionaries(test_dir / '1_secret')
def test_dictionaries_2_username_secret():
"tests the output"
_test_dictionaries(test_dir / '2_username_secret')
def test_dictionaries_3_leadership_secret():
"tests the output"
_test_dictionaries(test_dir / '3_leadership_secret')
def test_dictionaries_3_leadership_secret_several():
"tests the output"
_test_dictionaries(test_dir / '3_leadership_secret_several')
def test_dictionaries_4_several_secrets():
"tests the output"
_test_dictionaries(test_dir / '4_several_secrets')
def test_dictionaries_5_default_value():
"tests the output"
with raises(DictConsistencyError) as err:
_test_dictionaries(test_dir / '5_default_value')
assert err.errno == 304
def test_dictionaries_6_leadership_secret_default_value():
"tests the output"
with raises(DictConsistencyError) as err:
_test_dictionaries(test_dir / '6_leadership_secret_default_value')
assert err.errno == 304
def test_dictionaries_6_leadership_secret_follower_variable():
"tests the output"
with raises(DictConsistencyError) as err:
_test_dictionaries(test_dir / '6_leadership_secret_follower_variable')
assert err.errno == 303
def test_dictionaries_8_multi_variable():
"tests the output"
with raises(DictConsistencyError) as err:
_test_dictionaries(test_dir / '8_multi_variable')
assert err.errno == 302
def test_dictionaries_9_unknown_type():
"tests the output"
with raises(DictConsistencyError) as err:
_test_dictionaries(test_dir / '9_unknown_type')
assert err.errno == 301