Skip to content
Snippets Groups Projects
Commit 5bd2965a authored by Owen Arnold's avatar Owen Arnold
Browse files

Python exports and test for __eq__

parent 59d9ff3c
No related branches found
No related tags found
No related merge requests found
...@@ -243,5 +243,6 @@ void export_Run() { ...@@ -243,5 +243,6 @@ void export_Run() {
.def("__setitem__", &addOrReplaceProperty, .def("__setitem__", &addOrReplaceProperty,
(arg("self"), arg("name"), arg("value"))) (arg("self"), arg("name"), arg("value")))
.def("__copy__", &Mantid::PythonInterface::generic__copy__<Run>) .def("__copy__", &Mantid::PythonInterface::generic__copy__<Run>)
.def("__deepcopy__", &Mantid::PythonInterface::generic__deepcopy__<Run>); .def("__deepcopy__", &Mantid::PythonInterface::generic__deepcopy__<Run>)
.def("__eq__", &Run::operator==, arg("self"), arg("other"));
} }
...@@ -155,6 +155,12 @@ class RunTest(unittest.TestCase): ...@@ -155,6 +155,12 @@ class RunTest(unittest.TestCase):
def test_deep_copyable(self): def test_deep_copyable(self):
self.do_test_copyable(copy.deepcopy) self.do_test_copyable(copy.deepcopy)
def test_equals(self):
other = copy.deepcopy(self._run)
self.assertEqual(self._run, other)
other.addProperty("pressure", 1, True)
self.assertNotEqual(self._run, other)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
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