Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.io.base
Commits
7037cd22
Commit
7037cd22
authored
10 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Added test for Repr function
parent
927f4316
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/io/base/hdf5.cpp
+2
-0
2 additions, 0 deletions
bob/io/base/hdf5.cpp
bob/io/base/test_hdf5.py
+4
-0
4 additions, 0 deletions
bob/io/base/test_hdf5.py
with
6 additions
and
0 deletions
bob/io/base/hdf5.cpp
+
2
−
0
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
)
}
...
...
This diff is collapsed.
Click to expand it.
bob/io/base/test_hdf5.py
+
4
−
0
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment