diff options
author | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2020-11-30 12:16:10 +0100 |
---|---|---|
committer | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2020-11-30 12:16:10 +0100 |
commit | 96fb2df0e33b34a4dbb75577de8589a8611759c4 (patch) | |
tree | 7405641226ff632199336936c602f402b0427de4 /test/testCheckedAttributes.py | |
parent | f6fd16282811d1a686b5ae611351b0f8eed3c008 (diff) |
New upstream version 2.8.1
Diffstat (limited to 'test/testCheckedAttributes.py')
-rw-r--r-- | test/testCheckedAttributes.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/test/testCheckedAttributes.py b/test/testCheckedAttributes.py index 89bbe4c..f57d0c7 100644 --- a/test/testCheckedAttributes.py +++ b/test/testCheckedAttributes.py @@ -26,7 +26,7 @@ import unittest
from ldap3 import ALL
-from test.config import test_base, test_name_attr, random_id, get_connection, add_user, drop_connection, test_int_attr, test_server_type
+from test.config import test_base, test_name_attr, random_id, get_connection, add_user, drop_connection, test_int_attr, test_server_type, get_response_values
testcase_id = ''
@@ -49,12 +49,7 @@ class Test(unittest.TestCase): self.assertFalse(self.connection.bound)
def test_search_checked_attributes(self):
- result = self.connection.search(search_base=test_base, search_filter='(' + test_name_attr + '=' + testcase_id + 'chk-1*)', attributes=[test_name_attr, 'sn', test_int_attr])
- if not self.connection.strategy.sync:
- response, result = self.connection.get_response(result)
- else:
- response = self.connection.response
- result = self.connection.result
+ status, result, response, request = get_response_values(self.connection.search(search_base=test_base, search_filter='(' + test_name_attr + '=' + testcase_id + 'chk-1*)', attributes=[test_name_attr, 'sn', test_int_attr]), self.connection)
self.assertEqual(result['description'], 'success')
self.assertEqual(len(response), 1)
if test_server_type == 'AD':
@@ -83,12 +78,7 @@ class Test(unittest.TestCase): '2.5.4.4': lambda v: unicode(v, encoding='UTF-8')[::-1], # sn reversed
'1.3.6.1.4.1.1466.115.121.1.27': lambda v: int(v) + 1000} # integer syntax incremented by 1000
self.connection.server.custom_formatter = formatter
- result = self.connection.search(search_base=test_base, search_filter='(' + test_name_attr + '=' + testcase_id + 'chk-1*)', attributes=[test_name_attr, 'sn', test_int_attr])
- if not self.connection.strategy.sync:
- response, result = self.connection.get_response(result)
- else:
- response = self.connection.response
- result = self.connection.result
+ status, result, response, request = get_response_values(self.connection.search(search_base=test_base, search_filter='(' + test_name_attr + '=' + testcase_id + 'chk-1*)', attributes=[test_name_attr, 'sn', test_int_attr]), self.connection)
self.assertEqual(result['description'], 'success')
self.assertEqual(len(response), 1)
if test_server_type == 'AD':
|