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

Expose via Sample __eq__

parent 3ec9a185
No related branches found
No related tags found
No related merge requests found
...@@ -87,5 +87,6 @@ void export_Sample() { ...@@ -87,5 +87,6 @@ void export_Sample() {
return_internal_reference<>()) return_internal_reference<>())
.def("__copy__", &Mantid::PythonInterface::generic__copy__<Sample>) .def("__copy__", &Mantid::PythonInterface::generic__copy__<Sample>)
.def("__deepcopy__", .def("__deepcopy__",
&Mantid::PythonInterface::generic__deepcopy__<Sample>); &Mantid::PythonInterface::generic__deepcopy__<Sample>)
.def("__eq__", &Sample::operator==,(arg("self"), arg("other")));
} }
...@@ -124,8 +124,12 @@ class SampleTest(unittest.TestCase): ...@@ -124,8 +124,12 @@ class SampleTest(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):
a = Sample()
b = Sample()
self.assertEqual(a, b)
b.setThickness(10)
self.assertNotEqual(a, b)
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