Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F62388214
test_line.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
Sun, May 12, 20:45
Size
961 B
Mime Type
text/x-python
Expires
Tue, May 14, 20:45 (2 d)
Engine
blob
Format
Raw Data
Handle
17641209
Attached To
rNIETZSCHEPYTHON nietzsche-python
test_line.py
View Options
import
unittest
from
os
import
sep
,
path
from
os.path
import
isdir
,
dirname
import
lxml.etree
as
ET
import
sys
import
sys
sys
.
path
.
append
(
'svgscripts'
)
from
datatypes.line
import
Line
class
TestLineNumber
(
unittest
.
TestCase
):
def
setUp
(
self
):
DATADIR
=
dirname
(
__file__
)
+
sep
+
'test_data'
self
.
test_target_file
=
DATADIR
+
sep
+
'test.xml'
self
.
id
=
24
def
test_init
(
self
):
lnr
=
Line
(
id
=
self
.
id
)
self
.
assertEqual
(
lnr
.
id
,
self
.
id
)
def
test_init_from_xml
(
self
):
xml_tree
=
ET
.
parse
(
self
.
test_target_file
)
lines
=
[
Line
.
create_cls_from_node
(
node
=
node
)
for
node
in
xml_tree
.
getroot
()
.
xpath
(
'.//line-number'
)
]
self
.
assertEqual
(
len
(
lines
),
49
)
self
.
assertEqual
(
lines
[
0
]
.
id
,
1
)
self
.
assertEqual
(
lines
[
48
]
.
id
,
49
)
def
test_get_semanticAndDataDict
(
self
):
#print(Line.get_semantic_dictionary())
pass
if
__name__
==
"__main__"
:
unittest
.
main
()
Event Timeline
Log In to Comment