|
|
Mads Kiilerich
|
5e46f73f0d1c
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
754dbf31b551
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
e63bcce18fef
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
e527cc2ce8dc
|
6 years ago
|
|
cleanup: get rid of most "import *"
Apply script generated with the following hack: ( hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.*'(.*)' may be undefined, or defined from star imports.*/sed -ri 's,\\\\<\2\\\\>([^=]|$),XXXX.\2\\\\1,g' \1/gp" | sort -u hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.* undefined name '(.*)'$/sed -ri 's,\\\\<\2\\\\>([^=]|$),XXXX.\2\\\\1,g' \1/gp" | sort -u hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.*'(from .*)\.([^.]*) import \*' used.*/sed -ri 's,\\\\<XXXX\\\\.,\3.,g' \1/gp" | sort -u hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.*'(from .*)\.([^.]*) import \*' used.*/sed -ri 's,\2\\\\.\3 .*,\2 import \3,g' \1/gp" | sort -u ) | grep -v kallithea/bin/kallithea_cli_ishell.py > fix2.sh
|
|
|
Mads Kiilerich
|
45bfab30d433
|
6 years ago
|
|
py3: add b'' annotations in some places where they will be needed later
Mostly entirely trivial adding of b prefix that is a ignored for py2 ... and also a bit of related trivial reformatting/refactorings.
|
|
|
Mads Kiilerich
|
0a277465fddf
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
09100b3b8f42
|
6 years ago
|
|
|
|
|
Chris Rule
|
861ef58bc36e
|
8 years ago
|
|
auth: add https ability to the crowd auth module (issue #315)
[Thomas De Schampheleire: - use select iso checkbox to remove need for bool->string conversion - update tests]
|
|
|
Lars Kruse
|
7691290837d2
|
8 years ago
|
|
codingstyle: trivial whitespace fixes
Reported by flake8.
|
|
|
Mads Kiilerich
|
7ce3897bacd0
|
9 years ago
|
|
auth: make ldap OPT_X_TLS_CACERTDIR configurable
A location was hardcoded. The location was wrong for many systems and prevented actual TLS from working. Also, it should not be necessary with modern Pythons.
For some reason, instead of removing it, we now decide to expose it to the user. Choice FTW!
|
|
|
Thomas De Schampheleire
|
8d98924c58b1
|
9 years ago
|
|
tests: add as little code as possible in __init__.py
kallithea/tests/__init__.py contained quite a lot of code, including the test base class TestController. This in itself may be considered bad practice.
Specifically, this poses a problem when using pytest 3.0+, in which asserts in some files are not automatically rewritten to give improved assert output. That problem can be fixed by explicitly registering such files for assertion rewriting, but that register call should be executed _before_ said files are imported. I.e. if the register call is in kallithea/tests/__init__.py, assert calls in __init__.py itself can not be rewritten.
Since the TestController base class does effectively contain asserts, and we do not want to execute the register call from somewhere outside the kallithea/tests directory, we need to move the TestController class to another file (kallithea/tests/base.py) so we can have a register call in __init__.py before loading base.py.
While not strictly necessary to fix the mentioned pytest problem, we take the opportunity to fully clean __init__.py and move everything to the new kallithea/tests/base.py. While doing so, unnecessary imports are removed, and imports are ordered alphabetically. Explicit imports of symbols from modules that were already imported as a whole, are removed in favor of fully qualifying the references (e.g. tempfile._RandomNameSequence).
|
|
|
Thomas De Schampheleire
|
7f2aa3ec2931
|
10 years ago
|
|
pytest migration: rename TestControllerPytest back to TestController
The name TestControllerPytest was introduced to allow a temporary situation where nose/unittest and pytest-based tests could coexist. This situation is now over, so the base test class can be renamed again.
|
|
|
Thomas De Schampheleire
|
be1d366f461c
|
10 years ago
|
|
pytest migration: functional: switch to standard assert statements
Use unittest2pytest to replace unittest-style assert statements (e.g. assertEqual) with standard Python assert statements to benefit from pytest's improved reporting on assert failures.
The conversion by unittest2pytest was correct, except for line wrapping problems.
|
|
|
Thomas De Schampheleire
|
5adc4ad9ce77
|
10 years ago
|
|
pytest migration: convert simple functional tests to TestControllerPytest
Replace usage of TestController with TestControllerPytest for those files in tests/functional where there is no setUp/tearDown method (the pytest equivalent to be investigated) and that do not use test parametrization.
|
|
|
Thomas De Schampheleire
|
b755464eff8d
|
10 years ago
|
|
pytest migration: use pytest test skipping instead of nose's While the nose test skipping still worked, we want to remove all remnants of nose, so switch to the pytest equivalent. Note: due to a bug in pytest-sugar (reported at [1]) the skipped tests are not shown explicitly when using the 'skipif' approach, while they were with the nose approach. Since pytest-sugar is not enabled yet in setup.py, this is not deemed a problem. [1] https://github.com/Frozenball/pytest-sugar/issues/75
|
|
|
domruf
|
ada6571a6d27
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
8ccc02375c0d
|
10 years ago
|
|
tests: basic tests that the pam and crowd auth modules can be enabled
Will at least give a minimal check for syntax errors ...
|
|
|
Søren Løvborg
|
f103b1a2383b
|
10 years ago
|
|
BaseController: hide "Log out" link for external login sessions
If user is authorized by external means (API key or container auth), Kallithea is not actually able to log the user out and should not show the "Log out" link.
|
|
|
Søren Løvborg
|
bf1fc4c84e5f
|
10 years ago
|
|
BaseController: enable container authentication on all pages
Previously, user had to visit the login page to log in using container authentication; this now happens on every page load, unless user has an existing login session.
The container authentication result is cached in session on success.
|
|
|
Mads Kiilerich
|
0efca3ad8467
|
11 years ago
|
|
tests: provide _authentication_token when POSTing
So far not used, just preparing for the the time when the actual checking is introduced ...
This change is very verbose. self.app.post should perhaps just at this value automagically ...
|
|
|
Mads Kiilerich
|
7a9a231d365d
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
de26de99ac5b
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
9daad8c50b37
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
d1addaf7a91e
|
11 years ago
|
|
Second step in two-part process to rename directories. This is the actual directory rename.
|