Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61926165
test_super_page.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
Thu, May 9, 20:52
Size
967 B
Mime Type
text/x-python
Expires
Sat, May 11, 20:52 (2 d)
Engine
blob
Format
Raw Data
Handle
17578673
Attached To
rNIETZSCHEPYTHON nietzsche-python
test_super_page.py
View Options
import
unittest
from
os
import
sep
,
path
from
os.path
import
isdir
,
dirname
,
basename
import
lxml.etree
as
ET
import
sys
import
sys
sys
.
path
.
append
(
'svgscripts'
)
from
datatypes.super_page
import
SuperPage
class
TestSuperPage
(
unittest
.
TestCase
):
def
test_init
(
self
):
sp
=
SuperPage
(
title
=
'test'
,
page_number
=
1
)
self
.
assertEqual
(
sp
.
page_tree
.
getroot
()
.
get
(
'title'
),
'test'
)
self
.
assertEqual
(
sp
.
page_tree
.
getroot
()
.
get
(
'page-number'
),
'1'
)
self
.
assertEqual
(
sp
.
tag
,
'super-page'
)
def
test_remove_tags
(
self
):
sp
=
SuperPage
(
title
=
'test'
,
page_number
=
1
)
tag
=
'test'
numTags
=
3
for
i
in
range
(
numTags
):
ET
.
SubElement
(
sp
.
page_tree
.
getroot
(),
tag
)
self
.
assertEqual
(
len
(
sp
.
page_tree
.
xpath
(
'//'
+
tag
)),
numTags
)
sp
.
remove_tags_from_page_tree
([
tag
])
self
.
assertEqual
(
len
(
sp
.
page_tree
.
xpath
(
'//'
+
tag
)),
0
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Event Timeline
Log In to Comment