Merge pull request #284 from YunoHost/actions/black

Format Python code with Black
This commit is contained in:
Alexandre Aubin 2021-08-25 21:04:49 +02:00 committed by GitHub
commit e1f9fe1fcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 158 additions and 98 deletions

View file

@ -18,18 +18,21 @@
import os import os
import sys import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))
import sys import sys
from mock import Mock as MagicMock from mock import Mock as MagicMock
class Mock(MagicMock): class Mock(MagicMock):
@classmethod @classmethod
def __getattr__(cls, name): def __getattr__(cls, name):
return MagicMock() return MagicMock()
MOCK_MODULES = ['ldap', 'ldap.modlist', 'ldap.sasl']
MOCK_MODULES = ["ldap", "ldap.modlist", "ldap.sasl"]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
@ -42,36 +45,38 @@ sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = ['sphinx.ext.autodoc', extensions = [
'sphinx.ext.intersphinx', "sphinx.ext.autodoc",
'sphinx.ext.todo', "sphinx.ext.intersphinx",
'sphinx.ext.viewcode'] "sphinx.ext.todo",
"sphinx.ext.viewcode",
]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ["_templates"]
# The suffix(es) of source filenames. # The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# #
# source_suffix = ['.rst', '.md'] # source_suffix = ['.rst', '.md']
source_suffix = '.rst' source_suffix = ".rst"
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = "index"
# General information about the project. # General information about the project.
project = u'Moulinette' project = u"Moulinette"
copyright = u'2017, YunoHost Collective' copyright = u"2017, YunoHost Collective"
author = u'YunoHost Collective' author = u"YunoHost Collective"
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = u'2.6.1' version = u"2.6.1"
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = u'2.6.1' release = u"2.6.1"
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@ -83,10 +88,10 @@ language = None
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path # This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = "sphinx"
# If true, `todo` and `todoList` produce output, else they produce nothing. # If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True todo_include_todos = True
@ -97,7 +102,7 @@ todo_include_todos = True
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
# #
html_theme = 'classic' html_theme = "classic"
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
@ -108,7 +113,7 @@ html_theme = 'classic'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = ["_static"]
# Custom sidebar templates, must be a dictionary that maps document names # Custom sidebar templates, must be a dictionary that maps document names
# to template names. # to template names.
@ -116,11 +121,11 @@ html_static_path = ['_static']
# This is required for the alabaster theme # This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = { html_sidebars = {
'**': [ "**": [
# 'about.html', # 'about.html',
# 'navigation.html', # 'navigation.html',
# 'relations.html', # needs 'show_related': True theme option to display # 'relations.html', # needs 'show_related': True theme option to display
'searchbox.html', "searchbox.html",
# 'donate.html', # 'donate.html',
] ]
} }
@ -129,7 +134,7 @@ html_sidebars = {
# -- Options for HTMLHelp output ------------------------------------------ # -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'Moulinettedoc' htmlhelp_basename = "Moulinettedoc"
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
@ -138,15 +143,12 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
# #
# 'papersize': 'letterpaper', # 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
# #
# 'pointsize': '10pt', # 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
# #
# 'preamble': '', # 'preamble': '',
# Latex figure (float) alignment # Latex figure (float) alignment
# #
# 'figure_align': 'htbp', # 'figure_align': 'htbp',
@ -156,8 +158,13 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, 'Moulinette.tex', u'Moulinette Documentation', (
u'YunoHost Collective', 'manual'), master_doc,
"Moulinette.tex",
u"Moulinette Documentation",
u"YunoHost Collective",
"manual",
),
] ]
@ -165,10 +172,7 @@ latex_documents = [
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [(master_doc, "moulinette", u"Moulinette Documentation", [author], 1)]
(master_doc, 'moulinette', u'Moulinette Documentation',
[author], 1)
]
# -- Options for Texinfo output ------------------------------------------- # -- Options for Texinfo output -------------------------------------------
@ -177,13 +181,17 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
(master_doc, 'Moulinette', u'Moulinette Documentation', (
author, 'Moulinette', 'One line description of project.', master_doc,
'Miscellaneous'), "Moulinette",
u"Moulinette Documentation",
author,
"Moulinette",
"One line description of project.",
"Miscellaneous",
),
] ]
# Example configuration for intersphinx: refer to the Python standard library. # Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None} intersphinx_mapping = {"https://docs.python.org/": None}

View file

@ -344,7 +344,7 @@ class _ActionsMapPlugin(object):
# Append other request params # Append other request params
req_params = list(request.params.decode().dict.items()) req_params = list(request.params.decode().dict.items())
# TODO test special chars in filename # TODO test special chars in filename
req_params+=list(request.files.dict.items()) req_params += list(request.files.dict.items())
for k, v in req_params: for k, v in req_params:
v = _format(v) v = _format(v)
if k not in params.keys(): if k not in params.keys():

View file

@ -6,54 +6,55 @@ from setuptools import setup, find_packages
from moulinette.globals import init_moulinette_env from moulinette.globals import init_moulinette_env
LOCALES_DIR = init_moulinette_env()['LOCALES_DIR'] LOCALES_DIR = init_moulinette_env()["LOCALES_DIR"]
# Extend installation # Extend installation
locale_files = [] locale_files = []
if "install" in sys.argv: if "install" in sys.argv:
# Evaluate locale files # Evaluate locale files
for f in os.listdir('locales'): for f in os.listdir("locales"):
if f.endswith('.json'): if f.endswith(".json"):
locale_files.append('locales/%s' % f) locale_files.append("locales/%s" % f)
install_deps = [ install_deps = [
'argcomplete', "argcomplete",
'psutil', "psutil",
'pytz', "pytz",
'pyyaml', "pyyaml",
'toml', "toml",
'python-ldap', "python-ldap",
'gevent-websocket', "gevent-websocket",
'bottle', "bottle",
] ]
test_deps = [ test_deps = [
'pytest', "pytest",
'pytest-cov', "pytest-cov",
'pytest-env', "pytest-env",
'pytest-mock', "pytest-mock",
'requests', "requests",
'requests-mock', "requests-mock",
'webtest' "webtest",
] ]
extras = { extras = {
'install': install_deps, "install": install_deps,
'tests': test_deps, "tests": test_deps,
} }
setup(name='Moulinette', setup(
version='2.0.0', name="Moulinette",
description='Prototype interfaces quickly and easily', version="2.0.0",
author='Yunohost Team', description="Prototype interfaces quickly and easily",
author_email='yunohost@yunohost.org', author="Yunohost Team",
url='http://yunohost.org', author_email="yunohost@yunohost.org",
license='AGPL', url="http://yunohost.org",
packages=find_packages(exclude=['test']), license="AGPL",
data_files=[(LOCALES_DIR, locale_files)], packages=find_packages(exclude=["test"]),
python_requires='>=3.7.*, <3.8', data_files=[(LOCALES_DIR, locale_files)],
install_requires=install_deps, python_requires=">=3.7.*, <3.8",
tests_require=test_deps, install_requires=install_deps,
extras_require=extras, tests_require=test_deps,
) extras_require=extras,
)

View file

@ -158,7 +158,9 @@ class TestAuthAPI:
== "Authentication required" == "Authentication required"
) )
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_login_ldap(self, moulinette_webapi, ldap_server, mocker): def test_login_ldap(self, moulinette_webapi, ldap_server, mocker):
mocker.patch( mocker.patch(
"moulinette.authenticators.ldap.Authenticator._get_uri", "moulinette.authenticators.ldap.Authenticator._get_uri",

View file

@ -38,6 +38,7 @@ def find_expected_string_keys():
continue continue
yield m yield m
############################################################################### ###############################################################################
# Load en locale json keys # # Load en locale json keys #
############################################################################### ###############################################################################

View file

@ -15,7 +15,9 @@ class TestLDAP:
"extra": {}, "extra": {},
} }
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_authenticate_simple_bind_with_admin(self, ldap_server): def test_authenticate_simple_bind_with_admin(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org" self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org"
@ -24,7 +26,9 @@ class TestLDAP:
assert ldap_interface.con assert ldap_interface.con
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_authenticate_simple_bind_with_wrong_user(self, ldap_server): def test_authenticate_simple_bind_with_wrong_user(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
self.ldap_conf["parameters"]["user_rdn"] = "cn=yoloswag,dc=yunohost,dc=org" self.ldap_conf["parameters"]["user_rdn"] = "cn=yoloswag,dc=yunohost,dc=org"
@ -37,7 +41,9 @@ class TestLDAP:
assert expected_msg in str(exception) assert expected_msg in str(exception)
assert ldap_interface.con is None assert ldap_interface.con is None
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_authenticate_simple_bind_with_rdn_wrong_password(self, ldap_server): def test_authenticate_simple_bind_with_rdn_wrong_password(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org" self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org"
@ -51,7 +57,9 @@ class TestLDAP:
assert ldap_interface.con is None assert ldap_interface.con is None
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_authenticate_simple_bind_anonymous(self, ldap_server): def test_authenticate_simple_bind_anonymous(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
self.ldap_conf["parameters"]["user_rdn"] = "" self.ldap_conf["parameters"]["user_rdn"] = ""
@ -60,7 +68,9 @@ class TestLDAP:
assert ldap_interface.con assert ldap_interface.con
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_authenticate_sasl_non_interactive_bind(self, ldap_server): def test_authenticate_sasl_non_interactive_bind(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
self.ldap_conf["parameters"][ self.ldap_conf["parameters"][
@ -73,7 +83,9 @@ class TestLDAP:
assert ldap_interface.con assert ldap_interface.con
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_authenticate_server_down(self, ldap_server, mocker): def test_authenticate_server_down(self, ldap_server, mocker):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org" self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org"
@ -99,7 +111,9 @@ class TestLDAP:
ldap_interface.authenticate(password=password) ldap_interface.authenticate(password=password)
return ldap_interface return ldap_interface
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_admin_read(self, ldap_server): def test_admin_read(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -120,7 +134,9 @@ class TestLDAP:
assert list(admin_info.keys()) == ["userPassword"] assert list(admin_info.keys()) == ["userPassword"]
assert admin_info["userPassword"][0].startswith("{CRYPT}$6$") assert admin_info["userPassword"][0].startswith("{CRYPT}$6$")
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_sasl_read(self, ldap_server): def test_sasl_read(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -142,7 +158,9 @@ class TestLDAP:
assert list(admin_info.keys()) == ["userPassword"] assert list(admin_info.keys()) == ["userPassword"]
assert admin_info["userPassword"][0].startswith("{CRYPT}$6$") assert admin_info["userPassword"][0].startswith("{CRYPT}$6$")
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_anonymous_read(self, ldap_server): def test_anonymous_read(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface("") ldap_interface = self.create_ldap_interface("")
@ -181,7 +199,9 @@ class TestLDAP:
"uid=%s,ou=users,dc=yunohost,dc=org" % new_user, attrs=None "uid=%s,ou=users,dc=yunohost,dc=org" % new_user, attrs=None
)[0] )[0]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_admin_add(self, ldap_server): def test_admin_add(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -199,7 +219,9 @@ class TestLDAP:
assert "inetOrgPerson" in new_user_info["objectClass"] assert "inetOrgPerson" in new_user_info["objectClass"]
assert "posixAccount" in new_user_info["objectClass"] assert "posixAccount" in new_user_info["objectClass"]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_sasl_add(self, ldap_server): def test_sasl_add(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -218,7 +240,9 @@ class TestLDAP:
assert "inetOrgPerson" in new_user_info["objectClass"] assert "inetOrgPerson" in new_user_info["objectClass"]
assert "posixAccount" in new_user_info["objectClass"] assert "posixAccount" in new_user_info["objectClass"]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_anonymous_add(self, ldap_server): def test_anonymous_add(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface("") ldap_interface = self.create_ldap_interface("")
@ -253,7 +277,9 @@ class TestLDAP:
assert expected_error in str(exception) assert expected_error in str(exception)
assert expected_message in str(exception) assert expected_message in str(exception)
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_admin_remove(self, ldap_server): def test_admin_remove(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -262,7 +288,9 @@ class TestLDAP:
self.remove_new_user(ldap_interface) self.remove_new_user(ldap_interface)
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_sasl_remove(self, ldap_server): def test_sasl_remove(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -272,7 +300,9 @@ class TestLDAP:
self.remove_new_user(ldap_interface) self.remove_new_user(ldap_interface)
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_anonymous_remove(self, ldap_server): def test_anonymous_remove(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface("") ldap_interface = self.create_ldap_interface("")
@ -308,7 +338,9 @@ class TestLDAP:
"uid=%s,ou=users,dc=yunohost,dc=org" % uid, attrs=None "uid=%s,ou=users,dc=yunohost,dc=org" % uid, attrs=None
)[0] )[0]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_admin_update(self, ldap_server): def test_admin_update(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -320,7 +352,9 @@ class TestLDAP:
assert new_user_info["uidNumber"] == ["555"] assert new_user_info["uidNumber"] == ["555"]
assert new_user_info["gidNumber"] == ["555"] assert new_user_info["gidNumber"] == ["555"]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_admin_update_new_rdn(self, ldap_server): def test_admin_update_new_rdn(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -332,7 +366,9 @@ class TestLDAP:
assert new_user_info["uidNumber"] == ["555"] assert new_user_info["uidNumber"] == ["555"]
assert new_user_info["gidNumber"] == ["555"] assert new_user_info["gidNumber"] == ["555"]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_sasl_update(self, ldap_server): def test_sasl_update(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -345,7 +381,9 @@ class TestLDAP:
assert new_user_info["uidNumber"] == ["555"] assert new_user_info["uidNumber"] == ["555"]
assert new_user_info["gidNumber"] == ["555"] assert new_user_info["gidNumber"] == ["555"]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_sasl_update_new_rdn(self, ldap_server): def test_sasl_update_new_rdn(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -357,7 +395,9 @@ class TestLDAP:
assert new_user_info["uidNumber"] == ["555"] assert new_user_info["uidNumber"] == ["555"]
assert new_user_info["gidNumber"] == ["555"] assert new_user_info["gidNumber"] == ["555"]
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_anonymous_update(self, ldap_server): def test_anonymous_update(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface("") ldap_interface = self.create_ldap_interface("")
@ -370,7 +410,9 @@ class TestLDAP:
assert expected_error in str(exception) assert expected_error in str(exception)
assert expected_message in str(exception) assert expected_message in str(exception)
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_anonymous_update_new_rdn(self, ldap_server): def test_anonymous_update_new_rdn(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface("") ldap_interface = self.create_ldap_interface("")
@ -383,7 +425,9 @@ class TestLDAP:
assert expected_error in str(exception) assert expected_error in str(exception)
assert expected_message in str(exception) assert expected_message in str(exception)
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_empty_update(self, ldap_server): def test_empty_update(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -399,7 +443,9 @@ class TestLDAP:
assert ldap_interface.update("uid=%s,ou=users" % uid, new_user_info) assert ldap_interface.update("uid=%s,ou=users" % uid, new_user_info)
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_get_conflict(self, ldap_server): def test_get_conflict(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(
@ -418,7 +464,9 @@ class TestLDAP:
conflict = ldap_interface.get_conflict({"uid": "not_a_user"}) conflict = ldap_interface.get_conflict({"uid": "not_a_user"})
assert not conflict assert not conflict
@pytest.mark.skip(reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway...") @pytest.mark.skip(
reason="Not passing because setup issue idk, to be removed or moved to Yunohost soon anyway..."
)
def test_validate_uniqueness(self, ldap_server): def test_validate_uniqueness(self, ldap_server):
self.ldap_conf["parameters"]["uri"] = ldap_server.uri self.ldap_conf["parameters"]["uri"] = ldap_server.uri
ldap_interface = self.create_ldap_interface( ldap_interface = self.create_ldap_interface(