Skip to content

Commit

Permalink
Add type to Property python export. Refs #6677
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Mar 14, 2013
1 parent 744536b commit 62cc500
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void export_Property()
"The property's doc string")
.add_property("direction", &Mantid::Kernel::Property::direction,
"Input, Output, InOut or Unknown. See the Direction class")
.add_property("type", make_function(&Mantid::Kernel::Property::type), "Returns a string identifier for the type")
.add_property("units", make_function(&Mantid::Kernel::Property::units, return_value_policy<copy_const_reference>()),
"The units attached to this property")
.add_property("valueAsStr", &Mantid::Kernel::Property::value, "The value of the property as a string. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def setUp(self):
self.__class__._mask_dets = AlgorithmManager.createUnmanaged("MaskDetectors")
self.__class__._mask_dets.initialize()

def test_type_str_is_not_empty(self):
rangeLower=self.__class__._integration.getProperty("RangeLower")
self.assertTrue(len(rangeLower.type) > 0)

def test_getproperty_value_returns_derived_type(self):
data = [1.0,2.0,3.0]
alg = run_algorithm('CreateWorkspace',DataX=data,DataY=data,NSpec=1,UnitX='Wavelength',child=True)
Expand Down

0 comments on commit 62cc500

Please sign in to comment.