temporary expected error : works only on my system (absolute directories)
This commit is contained in:
@@ -29,7 +29,7 @@ C'est la description de wikipedia https://fr.wikipedia.org/wiki/Jugement_majorit
|
|||||||
|
|
||||||
(https://en.wikipedia.org/wiki/Majority_judgment)
|
(https://en.wikipedia.org/wiki/Majority_judgment)
|
||||||
|
|
||||||
L'implémentaion est très basique et miminale :
|
L'implémentation est très basique et miminale :
|
||||||
|
|
||||||
|langage|code|
|
|langage|code|
|
||||||
|-----|---------------------|
|
|-----|---------------------|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Glue to use majortiy judgement algorithm in various polls applications
|
# Glue to use majority judgement algorithm in various polls applications
|
||||||
|
|
||||||
Initial trigger of this project is implementation of this in Nextcloud poll app https://github.com/nextcloud/polls/issues/3472, project pushed by https://www.astrolabe.coop/
|
Initial trigger of this project is implementation of this in Nextcloud poll app https://github.com/nextcloud/polls/issues/3472, project pushed by https://www.astrolabe.coop/
|
||||||
|
|
||||||
|
|||||||
16
samples/expected/6.stderr
Normal file
16
samples/expected/6.stderr
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[WARN] No /.resources.var found
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "/home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/samples/../code/parse_sample.py", line 19, in <module>
|
||||||
|
result = majority_judgment_run(poll)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "/home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/code/majority_judgment_method/__init__.py", line 39, in majority_judgment_run
|
||||||
|
voters=poll['voters']['count']
|
||||||
|
~~~~^^^^^^^^^^
|
||||||
|
KeyError: 'voters'
|
||||||
|
PHP Warning: Undefined array key "voters" in /home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/code/parse_sample.php on line 24
|
||||||
|
PHP Warning: Trying to access array offset on null in /home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/code/parse_sample.php on line 24
|
||||||
|
PHP Warning: Undefined array key "candidates" in /home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/code/parse_sample.php on line 25
|
||||||
|
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/code/parse_sample.php:26
|
||||||
|
Stack trace:
|
||||||
|
#0 {main}
|
||||||
|
thrown in /home/plhardy/clients/astrolabe/nextcloud/poll/jugement_majoritaire/code/parse_sample.php on line 26
|
||||||
@@ -2,7 +2,20 @@
|
|||||||
|
|
||||||
[[ -n $VIRTUAL_ENV ]] || source ../code/bin/activate
|
[[ -n $VIRTUAL_ENV ]] || source ../code/bin/activate
|
||||||
|
|
||||||
for (( i=0;i<7;i++ ))
|
|
||||||
|
expect_error()
|
||||||
|
{
|
||||||
|
sample=$1
|
||||||
|
# error case on purpose
|
||||||
|
resultdir=tmp
|
||||||
|
[[ -d ${resultdir} ]] || mkdir ${resultdir}
|
||||||
|
./check.sh $sample 2>${resultdir}/$sample.stderr
|
||||||
|
diff ${resultdir}/$sample.stderr expected/$sample.stderr
|
||||||
|
}
|
||||||
|
|
||||||
|
for (( i=0;i<6;i++ ))
|
||||||
do
|
do
|
||||||
./check.sh $i
|
./check.sh $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
expect_error 6
|
||||||
|
|||||||
Reference in New Issue
Block a user