#49637 Issue 49586 - Add py3 support to plugins test suite
Closed by spichugi. Opened by aadhikari.
aadhikari/389-ds-base plugin  into  master

Download 49637.patch

Description: Added py3 support by explicitly changing strings to bytes.
Added code for creating a new connection to make ldap communicate on localhost.

https://pagure.io/389-ds-base/issue/49586

rebased onto 219c2216ef041ab2ead5c0df9795fac95733667d

I think a more efficient way to fix the test suite is to fix the functions: _create_user, _create_group, etc. So they return the Bytes type values.
Fixing every variable through the tests seems not very efficient.

@spichugi yes mate that make sense, but it if we change that in the function it will return values in bytes but it will fail in https://pagure.io/389-ds-base/pull-request/49637#_4,74 as it will take 1st arg as string and won't take bytes.

@spichugi yes mate that make sense, but it if we change that in the function it will return values in bytes but it will fail in https://pagure.io/389-ds-base/pull-request/49637#_4,74 as it will take 1st arg as string and won't take bytes.

The appearance of this thing is much less common than the one you've changed.
You can use 'ensure_str' there.

rebased onto 10878617828a64715670dbb1758524d8cbcc077d

rebased onto a174d537f85c896b2b9e6faa1759e678b58e102b

It doesn't make sense. You can leave None as it is because it has NoneType anyway.

Why did you remove 'assert' here?

some strange trailing whitespaces

As I mentioned before, it is better to change it in one place: in the return of the function. So in this case, _get_group_dn should return bytes.

rebased onto fae125ee766f3fe133acdf7b8bf99902de02067b

rebased onto 248642d366f36d63a8b9f30cab1f499c8d43b0ad

Ok, I see why we can remove the assert.
When we do 'assert Entry', it returns Falso when there is no data.
https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/_entry.py#_82

So it doesn't make sense to have the function in the test suite.

Extra print statement

Currently, we generate parameters for the instance here:
https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/utils.py#_850

We don't use constants as PORT_STANDALONE anymore. I think we should use all the info from DirSrv() object instance itself - like topology_st.standalone.port

Beside that, LGTM. The test suites pass.

rebased onto e306a2d4dc226eb7539ff935cfc4f89aca4bef3e

Pull-Request has been merged by spichugi

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/2696

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata