Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
RWTHmoodle
exam-scan
Commits
9cea7dba
Commit
9cea7dba
authored
Apr 27, 2021
by
Christian Rohlfing
Browse files
Bugfix missing package in requirements for QR scan
parent
dfcb68bf
Pipeline
#455325
passed with stages
in 5 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
requirements.txt
View file @
9cea7dba
...
...
@@ -2,4 +2,5 @@ Wand==0.6.5
Pillow
==8.1.0
PyPDF2
==1.26.0
pwgen
==0.8.2.post0
pikepdf
==2.5.0
\ No newline at end of file
pikepdf
==2.5.0
pyzbar
==0.1.8
tests/test_qr.py
0 → 100644
View file @
9cea7dba
import
unittest
import
time
class
MainTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
tic
=
time
.
time
()
# todo this is sooo ugly
def
tearDown
(
self
):
self
.
toc
=
time
.
time
()
t
=
self
.
toc
-
self
.
tic
print
(
'Time: %.3f'
%
(
t
))
def
test_extract_first_qr
(
self
):
from
utils
import
qr
as
qr_utils
expected_qr
=
"23-16"
pdf_file
=
"./pdfs/456789_Lastname.pdf"
qr
=
qr_utils
.
first_qr_from_first_pdf_page
(
pdf_file
=
pdf_file
)
self
.
assertEqual
(
qr
,
expected_qr
)
def
test_extract_all_qrs
(
self
):
from
utils
import
qr
as
qr_utils
expected_qrs
=
[
[
'23-01'
],
[
'23-02'
],
[
'23-03'
],
[
'23-04'
],
[
'23-05'
],
[
'23-06'
],
[
'23-07'
],
[
'23-08'
],
[
'23-09'
],
[
'23-10'
],
[
'23-11'
],
[
'23-12'
],
[
'23-13'
],
[
'23-14'
],
[
'23-15'
],
[
'23-16'
]
]
# Parameters
dpi
=
200
pdf_file
=
"./pdfs/456789_Lastname.pdf"
# Decode all QRs
qrs
,
_
=
qr_utils
.
qrs_from_pdf
(
pdf_file
=
pdf_file
,
dpi
=
dpi
)
qrs
.
sort
()
self
.
assertEqual
(
qrs
,
expected_qrs
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment