Skip to content
Snippets Groups Projects
Commit 7037cd22 authored by Manuel Günther's avatar Manuel Günther
Browse files

Added test for Repr function

parent 927f4316
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment