Skip to content

Commit

Permalink
Re #9512. Expose Workspace::setComment to python and test.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed May 21, 2014
1 parent 0d39935 commit 144dd7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -25,6 +25,7 @@ void export_Workspace()
.def("getTitle", &Workspace::getTitle, args("self"), "Returns the title of the workspace")
.def("setTitle", &Workspace::setTitle, args("self", "title"))
.def("getComment", &Workspace::getComment, return_value_policy<copy_const_reference>(), "Returns the comment field on the workspace")
.def("setComment", &Workspace::setComment, args("self", "comment"))
.def("isDirty", &Workspace::isDirty, Workspace_isDirtyOverloads(arg("n"), "True if the workspace has run more than n algorithms (Default=1)"))
.def("getMemorySize", &Workspace::getMemorySize, args("self"), "Returns the memory footprint of the workspace in KB")
.def("getHistory", (const WorkspaceHistory &(Workspace::*)() const)&Workspace::getHistory, return_value_policy<reference_existing_object>(),
Expand Down
Expand Up @@ -321,12 +321,15 @@ def test_history_access(self):
self.assertEquals(first.getPropertyValue("OutputWorkspace"), "raw")
AnalysisDataService.remove('raw')

def test_setTitle(self):
def test_setTitleAndComment(self):
run_algorithm('CreateWorkspace', OutputWorkspace='ws1',DataX=[1.,2.,3.], DataY=[2.,3.], DataE=[2.,3.],UnitX='TOF')
ws1 = AnalysisDataService['ws1']
title = 'test_title'
ws1.setTitle(title)
self.assertEquals(title, ws1.getTitle())
comment = 'Some comment on this workspace.'
ws1.setComment(comment)
self.assertEquals(comment, ws1.getComment())
AnalysisDataService.remove(ws1.getName())

if __name__ == '__main__':
Expand Down

0 comments on commit 144dd7a

Please sign in to comment.