|
|
Mads Kiilerich
|
79567af5523e
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
644b7a16d29c
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
25c51511c8eb
|
5 years ago
|
|
hooks: put repo_size and update hooks in kallithea namespace Keep things separate. Include missing migration steps for 642847355a10.
|
|
|
Mads Kiilerich
|
761efb9624fa
|
5 years ago
|
|
hooks: use internal Mercurial module for update after push
Don't rely on having a working 'hg' command in $PATH.
|
|
|
Mads Kiilerich
|
5e46f73f0d1c
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
9bf701b246ba
|
6 years ago
|
|
tests: fix test_admin_settings test dependencies
Failure could be reproduced with py.test kallithea/tests/functional/test_admin_settings.py -k x
|
|
|
Mads Kiilerich
|
7172f3b0042b
|
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
|
0a277465fddf
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
09100b3b8f42
|
6 years ago
|
|
|
|
|
Thomas De Schampheleire
|
8e5450cd4686
|
7 years ago
|
|
admin: hooks: only flash 'Updated hooks' if there are changes
Clicking 'Save' on the hook administration page currently always renders the flash message 'Updated hooks' even if nothing was changed. This may be particularly confusing when the action you intended to do got an error, e.g. adding a hook that already exists, adding a builtin hook, ...
Instead, compare the old and new value when editing a hook, and only save and create the flash if they are different.
For this to be work correctly in test, the old value needs to be passed as well like in the real situation, otherwise the 'zip' operation will return an empty list.
|
|
|
Thomas De Schampheleire
|
40fea9b37a32
|
7 years ago
|
|
admin: hooks: prevent editing of builtin hooks (issue #226)
Builtin hooks are supposed to be read-only, but it was still possible to 'add' a new hook with the same name as an existing built-in one, changing its value.
|
|
|
Thomas De Schampheleire
|
d612fd653562
|
7 years ago
|
|
admin: hooks: prevent creation of existing custom hook
Trying to add a hook that already exists does not currently give an error but does not work.
Detect the situation and report via a flash.
|
|
|
Thomas De Schampheleire
|
cefc3010baaf
|
7 years ago
|
|
|
|
|
Thomas De Schampheleire
|
61f8ce5fff25
|
7 years ago
|
|
admin: hooks: check session flashes in tests
Add checking of the session flash when a new hook is added.
|
|
|
Mads Kiilerich
|
6304efbe37a3
|
8 years ago
|
|
tests: put all temporary files in one top directory
Use KALLITHEA_TESTS_TMP_PATH or a create a temporary /tmp/kallithea-test-* directory.
Some temporary files might still be placed in /tmp ... but nothing should be left behind.
|
|
|
domruf
|
8bd7a637cea0
|
9 years ago
|
|
template: use Bootstrap compatible navbar markup
Based on work from Andrew Shadura <andrew@shadura.me>.
Further modified by Mads Kiilerich.
|
|
|
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.
|
|
|
domruf
|
1a7611b9730e
|
10 years ago
|
|
|
|
|
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.
|
|
|
Søren Løvborg
|
c25191aadf92
|
10 years ago
|
|
db: fix Ui.get_by_key to also filter on section
Key alone is not enough to identify a Ui row.
|
|
|
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
|
d51a6f5e57d1
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
34a7bec2c525
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
f373f182b756
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
24c0d584ba86
|
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.
|