Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running tests with SERVER=NONE fails #1145

Open
jelly opened this issue May 16, 2024 · 0 comments
Open

Running tests with SERVER=NONE fails #1145

jelly opened this issue May 16, 2024 · 0 comments

Comments

@jelly
Copy link

jelly commented May 16, 2024

For packaging we want to run the unittests without an LDAP server, the tests still fail when I export SERVER=NONE in testLDIF-change.py. As test_name_attr is initialised to None. I assume tests should not get executed when SERVER=NONE?

======================================================================
ERROR: test_add_request_to_ldif (test.testLDIF-change.Test.test_add_request_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 55, in test_add_request_to_ldif
    self.connection.add(generate_dn(test_base, testcase_id, 'ldif-change-1'), 'inetOrgPerson', {'objectClass': 'inetOrgPerson', 'sn': 'ldif-change-1', test_name_attr: 'ldif-change-1', 'loginEnabled': True}, controls=controls)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

======================================================================
ERROR: test_delete_request_to_ldif (test.testLDIF-change.Test.test_delete_request_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 70, in test_delete_request_to_ldif
    self.connection.delete(generate_dn(test_base, testcase_id, 'ldif-change-2'))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

======================================================================
ERROR: test_modify_add_to_ldif (test.testLDIF-change.Test.test_modify_add_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 100, in test_modify_add_to_ldif
    result = self.connection.modify(generate_dn(test_base, testcase_id, 'ldif-change-6'), {'givenName': (MODIFY_ADD, ['givenname-6-modified'])})
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

======================================================================
ERROR: test_modify_delete_to_ldif (test.testLDIF-change.Test.test_modify_delete_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 124, in test_modify_delete_to_ldif
    result = self.connection.modify(generate_dn(test_base, testcase_id, 'ldif-change-8'), {'givenName': (MODIFY_DELETE, ['givenname-8-deleted'])})
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

======================================================================
ERROR: test_modify_dn_request_to_ldif (test.testLDIF-change.Test.test_modify_dn_request_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 77, in test_modify_dn_request_to_ldif
    result = self.connection.modify_dn(generate_dn(test_base, testcase_id, 'ldif-change-3'), test_name_attr + '=' + testcase_id + 'ldif-change-4,' + test_base)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

======================================================================
ERROR: test_modify_replace_to_ldif (test.testLDIF-change.Test.test_modify_replace_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 112, in test_modify_replace_to_ldif
    result = self.connection.modify(generate_dn(test_base, testcase_id, 'ldif-change-7'), {'givenName': (MODIFY_REPLACE, ['givenname-7-replaced'])})
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

======================================================================
ERROR: test_move_dn_request_to_ldif (test.testLDIF-change.Test.test_move_dn_request_to_ldif)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-ldap3/src/ldap3-2.9.1/test/testLDIF-change.py", line 88, in test_move_dn_request_to_ldif
    result = self.connection.modify_dn(generate_dn(test_base, testcase_id, 'ldif-change-5'), test_name_attr + '=' + testcase_id + 'ldif-change-5', delete_old_dn=False, new_superior=test_moved)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/python-ldap3/src/ldap3-2.9.1/test/config.py", line 525, in generate_dn
    return test_name_attr + '=' + batch_id + name + ',' + base
           ~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

----------------------------------------------------------------------
Ran 687 tests in 14.652s

FAILED (SKIP=234, errors=7)
Testing location: UNKNOWN-NONE  - Test server: None
Python version: 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417]  - ldap3 version: 2.9  - pyasn1 version: 0.5.1
Strategy: SYNC - Lazy: False - Check names: True - Collect usage: True  - pool size: 5
Default client encoding: utf-8  - Default server encoding: utf-8 - Source encoding: utf-8 - File encoding: utf-8  - Additional server encodings: latin-1, koi8-r
Logging: False - Log detail: None - Internal decoder:  True  - Response waiting timeout: 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant