ldap_backend: add a synchronization timeout block option (#63560) #20

Merged
pmarillonnet merged 1 commits from wip/63560-ldap-sync-timeout into main 2023-03-15 12:09:50 +01:00
Owner

Aucune fichue idée de comment tester cela correctement.

Aucune fichue idée de comment tester cela correctement.
pmarillonnet changed title from ldap_backend: add a synchronization timeout block option (#63560) to WIP: ldap_backend: add a synchronization timeout block option (#63560) 2023-03-14 16:45:13 +01:00
Owner

Aucune fichue idée de comment tester cela correctement.

Avec un mock/wrap sur LDAPObject.set_option pour vérifier que le bon timeout est posé.

Un truc genre:

@pytest.fixture
def wraps_ldap_set_option(monkeypatch):
    mock_set_option = Mock()
    from authentic2.backends.ldap_backend import LDAPObject
    old_set_option = LDAPObject.set_option
    def set_option(self, *args, **kwargs):
        mock_set_option(*args, **kwargs) 
        return old_set_option(self, *args, **kwargs
    monkeypatch.setattr('authentic2.backends.ldap_backend.LDAPObject.set_option', set_option)
    return mock_set_option

Le mock est juste là pour enregistrer les appels.

> Aucune fichue idée de comment tester cela correctement. Avec un mock/wrap sur LDAPObject.set_option pour vérifier que le bon timeout est posé. Un truc genre: ``` @pytest.fixture def wraps_ldap_set_option(monkeypatch): mock_set_option = Mock() from authentic2.backends.ldap_backend import LDAPObject old_set_option = LDAPObject.set_option def set_option(self, *args, **kwargs): mock_set_option(*args, **kwargs) return old_set_option(self, *args, **kwargs monkeypatch.setattr('authentic2.backends.ldap_backend.LDAPObject.set_option', set_option) return mock_set_option ``` Le mock est juste là pour enregistrer les appels.
pmarillonnet force-pushed wip/63560-ldap-sync-timeout from f8ea708d21 to de4d609305 2023-03-14 21:07:31 +01:00 Compare
pmarillonnet force-pushed wip/63560-ldap-sync-timeout from de4d609305 to a61a732a35 2023-03-15 11:00:44 +01:00 Compare
Author
Owner

Effectivement on peut tester les paramètres d’appel, bien vu, merci pour le tuyau.

Effectivement on peut tester les paramètres d’appel, bien vu, merci pour le tuyau.
pmarillonnet changed title from WIP: ldap_backend: add a synchronization timeout block option (#63560) to ldap_backend: add a synchronization timeout block option (#63560) 2023-03-15 11:14:59 +01:00
bdauvergne approved these changes 2023-03-15 11:50:05 +01:00
pmarillonnet merged commit a61a732a35 into main 2023-03-15 12:09:50 +01:00
pmarillonnet deleted branch wip/63560-ldap-sync-timeout 2023-03-15 12:09:50 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: entrouvert/authentic#20
No description provided.