File: t_ldap_asyncsearch.py

package info (click to toggle)
python-ldap 3.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,756 kB
  • sloc: python: 9,558; ansic: 3,052; makefile: 139; sh: 79
file content (24 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import importlib
import os
import unittest
import warnings

# Switch off processing .ldaprc or ldap.conf before importing _ldap
os.environ['LDAPNOINIT'] = '1'

import ldap.asyncsearch


class TestLdapAsyncSearch(unittest.TestCase):
    def test_deprecated(self):
        with warnings.catch_warnings(record=True) as w:
            warnings.resetwarnings()
            warnings.simplefilter('once', DeprecationWarning)
            old = importlib.import_module('ldap.async')
        self.assertEqual(len(w), 1)
        diff = set(dir(ldap.asyncsearch)).difference(dir(old))
        self.assertEqual(diff, set())


if __name__ == '__main__':
    unittest.main()