profile
viewpoint

zulip/zulip 12804

Zulip server and webapp - powerful open source team chat

zulip/fakeldap 13

A fake ldap implementation to be used in unittests.

zulip/zulip-zapier 1

Zulip's Zapier integration

eeshangarg/CS3716Scheduler 0

CS3716 Group Project - Scheduling System

eeshangarg/fakeldap 0

A fake ldap implementation to be used in unittests.

eeshangarg/nukefilewalker 0

A simple file indexer

eeshangarg/oh-mainline 0

The code that runs openhatch.org

eeshangarg/python-zulip 0

A repository for Zulip's API bindings

PR opened zulip/fakeldap

fakeldap.py: Don't rely on KeyError exceptions when accessing non-exi…

…stent keys of MockLDAP.directory.

The implementation of the internal MockLDAP.directory dictionary is defined via . self.directory = defaultdict(lambda: {}) . This results in a dictionary that always returns an empty dict for any key requested: . >>> print (self.directory['some_key']) {} . Thus, we cannot rely on the raisal of KeyError exceptions when accessing a non-existing LDAP DNs in the MockLDAP.directory. . Instead, we check if MockLDAP.directory['some_key'] returns an empty dict {} value.

+7 -9

0 comment

1 changed file

pr created time in 6 days

more