Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91236437
test_checker_handler.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 9, 06:03
Size
868 B
Mime Type
text/x-python
Expires
Mon, Nov 11, 06:03 (2 d)
Engine
blob
Format
Raw Data
Handle
22201322
Attached To
rNIETZSCHEPYTHON nietzsche-python
test_checker_handler.py
View Options
import
lxml.etree
as
ET
from
os
import
sep
,
path
,
remove
from
os.path
import
isdir
,
isfile
,
dirname
,
basename
import
shutil
import
sys
import
tempfile
import
unittest
import
warnings
from
checker_handler
import
CheckerHandler
sys
.
path
.
append
(
'svgscripts'
)
from
datatypes.page
import
Page
class
TestCheckerHandler
(
unittest
.
TestCase
):
def
setUp
(
self
):
DATADIR
=
path
.
dirname
(
__file__
)
+
sep
+
'test_data'
self
.
fix_boxes
=
DATADIR
+
sep
+
'Mp_XIV_page416.xml'
def
test_check_get_set
(
self
):
page
=
Page
(
self
.
fix_boxes
)
checker
=
CheckerHandler
(
page
)
checker
.
set_task_done
(
CheckerHandler
.
CHECKS
[
0
])
self
.
assertTrue
(
len
(
checker
.
get_todos
())
<
len
(
CheckerHandler
.
CHECKS
))
print
(
ET
.
dump
(
page
.
page_tree
.
xpath
(
f
'//metadata/{CheckerHandler.XML_TAG}'
)[
0
]))
if
__name__
==
"__main__"
:
unittest
.
main
()
Event Timeline
Log In to Comment