-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from bluedynamics/unittests
Unittests, Python 3
- Loading branch information
Showing
57 changed files
with
4,703 additions
and
462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
/.pydevproject.bak | ||
/.settings | ||
/.vscode/ | ||
/py2/ | ||
/py3/ | ||
/bin/ | ||
/coverage/ | ||
/develop-eggs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,25 @@ | ||
TODO | ||
==== | ||
|
||
- define what our retry logic should look like, re-think function of session, | ||
communicator and connector. (check ldap.ldapobject.ReconnectLDAPObject) | ||
ideas: more complex retry logic with fallback servers, eg. try immediately | ||
again, if that fails use backup server, then start to probe other server | ||
after a timespan, report status of ldap servers, preferred server, | ||
equal servers, load balancing; Are there ldap load balancers to recommend? | ||
|
||
- consider ``search_st`` with timeout. | ||
|
||
- investigate ``ReconnectLDAPObject.set_cache_options`` | ||
|
||
- check/implement silent sort on only the keys ``LDAPNode.sortonkeys`` | ||
- investigate ``ReconnectLDAPObject.set_cache_options``. | ||
|
||
- node.ext.ldap.filter unicode/utf-8 | ||
- check/implement silent sort on only the keys ``LDAPNode.sortonkeys``. | ||
|
||
- interactive configuration showing live how many users/groups are found with | ||
the current config and what a selected user/group would look like | ||
the current config and what a selected user/group would look like. | ||
|
||
- Configuration validation for UGM. Add some checks in ``Ugm.__init__`` which | ||
tries to block stupid configuration. | ||
|
||
- group in group support | ||
- group in group support. | ||
|
||
- rework ldap testsetup to allow for multiple servers in order to test with | ||
different overlays it would be nice to start different servers or have one | ||
server with multiple databases. whatever feels better. | ||
|
||
- rework tests and ldifs to target isolated aspects | ||
- rework tests and ldifs to target isolated aspects. | ||
|
||
- potentially multi-valued attrs always as list! | ||
- potentially multi-valued attrs always as list. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[buildout] | ||
extends = | ||
ldap.cfg | ||
versions.cfg | ||
parts += | ||
coverage | ||
test-coverage | ||
py | ||
pydev | ||
omelette | ||
|
||
[test] | ||
recipe = zc.recipe.testrunner | ||
eggs = | ||
${python-ldap:egg} | ||
node[test] | ||
node.ext.ugm | ||
node.ext.ldap[test] | ||
|
||
environment = testenv | ||
defaults = ['--auto-color', '--auto-progress'] | ||
|
||
[coverage] | ||
recipe = zc.recipe.egg | ||
eggs = coverage | ||
|
||
[test-coverage] | ||
recipe = collective.recipe.template | ||
input = inline: | ||
#!/bin/bash | ||
${buildout:directory}/bin/coverage run --source=${buildout:directory}/src/node/ext/ldap bin/test | ||
${buildout:directory}/bin/coverage html | ||
${buildout:directory}/bin/coverage report -m --fail-under=90 | ||
# Fail (exit status 1) if coverage returns exit status 2 (this happens | ||
# when test coverage is below 100%. | ||
output = ${buildout:directory}/bin/test-coverage | ||
mode = 755 | ||
|
||
[py] | ||
recipe = zc.recipe.egg | ||
interpreter = py | ||
eggs = ${test:eggs} | ||
scripts = | ||
|
||
[pydev] | ||
recipe = pb.recipes.pydev | ||
eggs = ${test:eggs} | ||
|
||
[omelette] | ||
recipe = collective.recipe.omelette | ||
eggs = ${test:eggs} | ||
ignore-develop = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,39 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
set -e | ||
|
||
# see https://community.plone.org/t/not-using-bootstrap-py-as-default/620 | ||
for dir in lib include local bin; do | ||
if [ -d "$dir" ]; then | ||
rm -r "$dir" | ||
function cleanup() { | ||
if [ -e "$1" ]; then | ||
rm -rf $1 | ||
fi | ||
done | ||
virtualenv --clear . | ||
./bin/pip install --upgrade pip setuptools zc.buildout | ||
./bin/buildout | ||
} | ||
|
||
function create_venv() { | ||
virtualenv --clear --no-site-packages -p $1 $2 | ||
} | ||
|
||
function copy_config() { | ||
cp ../ldap.cfg . | ||
cp ../versions.cfg . | ||
cp ../base.cfg . | ||
cp ../buildout.cfg . | ||
} | ||
|
||
function run_buildout() { | ||
pushd $1 | ||
copy_config | ||
./bin/pip install --upgrade pip setuptools zc.buildout | ||
./bin/buildout | ||
popd | ||
} | ||
|
||
if [ -x "$(which python)" ]; then | ||
cleanup py2 | ||
create_venv python py2 | ||
run_buildout py2 | ||
fi | ||
|
||
if [ -x "$(which python3)" ]; then | ||
cleanup py3 | ||
create_venv python3 py3 | ||
run_buildout py3 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,3 @@ | ||
[buildout] | ||
extends = | ||
ldap.cfg | ||
versions.cfg | ||
develop = . | ||
parts += | ||
smbpasswd | ||
coverage | ||
test-coverage | ||
py | ||
pydev | ||
omelette | ||
# dependencytree | ||
|
||
[smbpasswd] | ||
recipe = zc.recipe.egg | ||
eggs = smbpasswd | ||
find-links = http://barryp.org/static/software/download/py-smbpasswd/1.0.1/py-smbpasswd-1.0.1.tar.gz | ||
|
||
[test] | ||
recipe = zc.recipe.testrunner | ||
eggs = | ||
${python-ldap:egg} | ||
node[test] | ||
node.ext.ugm[test] | ||
node.ext.ldap[test] | ||
|
||
environment = testenv | ||
defaults = ['--auto-color', '--auto-progress'] | ||
|
||
[coverage] | ||
recipe = zc.recipe.egg | ||
eggs = coverage | ||
|
||
[test-coverage] | ||
recipe = collective.recipe.template | ||
input = inline: | ||
#!/bin/bash | ||
${buildout:directory}/bin/coverage run --source=${buildout:directory}/src/node/ext/ldap bin/test | ||
${buildout:directory}/bin/coverage html | ||
${buildout:directory}/bin/coverage report -m --fail-under=90 | ||
# Fail (exit status 1) if coverage returns exit status 2 (this happens | ||
# when test coverage is below 100%. | ||
output = ${buildout:directory}/bin/test-coverage | ||
mode = 755 | ||
|
||
[py] | ||
recipe = zc.recipe.egg | ||
interpreter = py | ||
eggs = ${test:eggs} | ||
scripts = | ||
|
||
[pydev] | ||
recipe = pb.recipes.pydev | ||
eggs = ${test:eggs} | ||
|
||
[omelette] | ||
recipe = collective.recipe.omelette | ||
eggs = ${test:eggs} | ||
ignore-develop = True | ||
|
||
#[dependencytree] | ||
#recipe = zc.recipe.egg | ||
#eggs = | ||
# ${test:eggs} | ||
# tl.eggdeps | ||
#ignore-develop = True | ||
#scripts = | ||
extends = base.cfg | ||
develop = .. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
LDAP | ||
==== | ||
|
||
|
||
LDAP in general | ||
--------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
./$1/bin/coverage run --source=./src/node/ext/ldap --omit=./src/node/ext/ldap/main.py ./$1/bin/test | ||
./$1/bin/coverage report | ||
./$1/bin/coverage html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
set -e | ||
TEST="bin/test node.ext.ldap" | ||
|
||
clear | ||
|
||
if [ -x "$(which python)" ]; then | ||
./py2/$TEST | ||
fi | ||
|
||
echo "" | ||
|
||
if [ -x "$(which python3)" ]; then | ||
./py3/$TEST | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.