Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.io.base
Commits
7037cd22
Commit
7037cd22
authored
Apr 17, 2015
by
Manuel Günther
Browse files
Added test for Repr function
parent
927f4316
Changes
2
Hide whitespace changes
Inline
Side-by-side
bob/io/base/hdf5.cpp
View file @
7037cd22
...
...
@@ -166,7 +166,9 @@ BOB_CATCH_MEMBER("hdf5 constructor", -1)
static
PyObject
*
PyBobIoHDF5File_repr
(
PyBobIoHDF5FileObject
*
self
)
{
BOB_TRY
return
PyString_FromFormat
(
"%s(filename='%s')"
,
Py_TYPE
(
self
)
->
tp_name
,
self
->
f
->
filename
().
c_str
());
BOB_CATCH_MEMBER
(
"__repr__"
,
0
)
}
...
...
bob/io/base/test_hdf5.py
View file @
7037cd22
...
...
@@ -458,6 +458,7 @@ def test_copy_constructor():
assert
hdf5
.
filename
!=
deep
.
filename
assert
hdf5
.
keys
()
!=
deep
.
keys
()
assert
hdf5
.
cwd
!=
deep
.
cwd
assert
str
(
shallow
)
hdf5
.
cd
(
".."
)
...
...
@@ -475,6 +476,9 @@ def test_copy_constructor():
def
test_filename
():
fn
=
shallow
.
filename
nose
.
tools
.
assert_raises
(
RuntimeError
,
test_filename
)
def
test_repr
():
fn
=
str
(
shallow
)
nose
.
tools
.
assert_raises
(
RuntimeError
,
test_repr
)
finally
:
os
.
unlink
(
tmpname
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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