diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp index c8f153e8715ca740be8dca73ea84a48e0cbba964..ffba827eca114e114acccf7424aca1d2c77eb0fc 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp @@ -87,5 +87,6 @@ void export_Sample() { return_internal_reference<>()) .def("__copy__", &Mantid::PythonInterface::generic__copy__<Sample>) .def("__deepcopy__", - &Mantid::PythonInterface::generic__deepcopy__<Sample>); + &Mantid::PythonInterface::generic__deepcopy__<Sample>) + .def("__eq__", &Sample::operator==,(arg("self"), arg("other"))); } diff --git a/Framework/PythonInterface/test/python/mantid/api/SampleTest.py b/Framework/PythonInterface/test/python/mantid/api/SampleTest.py index 845075019e5fab9405f5bdd69b095495f9483a27..f3f7244902d721d2c1488bcc47e429a8e5f4eea6 100644 --- a/Framework/PythonInterface/test/python/mantid/api/SampleTest.py +++ b/Framework/PythonInterface/test/python/mantid/api/SampleTest.py @@ -124,8 +124,12 @@ class SampleTest(unittest.TestCase): def test_deep_copyable(self): 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__': unittest.main()