Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65156358
test_attachable_object.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, Jun 1, 07:26
Size
702 B
Mime Type
text/x-python
Expires
Mon, Jun 3, 07:26 (2 d)
Engine
blob
Format
Raw Data
Handle
18014044
Attached To
rNIETZSCHEPYTHON nietzsche-python
test_attachable_object.py
View Options
import
unittest
from
os
import
sep
,
path
import
lxml.etree
as
ET
import
sys
sys
.
path
.
append
(
'svgscripts'
)
from
datatypes.attachable_object
import
AttachableObject
class
TestObjectFail
(
AttachableObject
):
def
__init__
(
self
):
pass
class
TestObjectOK
(
AttachableObject
):
def
attach_object_to_tree
(
self
,
target_tree
):
return
True
class
TestPositionalObject
(
unittest
.
TestCase
):
def
test_fail
(
self
):
with
self
.
assertRaises
(
TypeError
):
TestObjectFail
()
def
test_success
(
self
):
test
=
TestObjectOK
()
self
.
assertEqual
(
test
.
attach_object_to_tree
(
ET
.
ElementTree
(
ET
.
Element
(
'asdf'
))),
True
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Event Timeline
Log In to Comment