-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Python exports to create AlgorithmProperty from Python.
Required to match behavour with old API. Refs #7469
- Loading branch information
1 parent
94b0abc
commit 570ec2f
Showing
5 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Code/Mantid/Framework/PythonInterface/test/python/mantid/api/AlgorithmPropertyTest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import unittest | ||
from mantid.api import AlgorithmProperty, IAlgorithm | ||
from mantid.kernel import Direction | ||
|
||
class AlgorithmPropertyTest(unittest.TestCase): | ||
|
||
def test_construction_with_name_produces_input_property(self): | ||
prop = AlgorithmProperty("TestProperty") | ||
|
||
self.assertEquals(Direction.Input, prop.direction) | ||
|
||
def test_value_method_returns_an_algorithm_type(self): | ||
prop = AlgorithmProperty("TestProperty") | ||
prop.valueAsStr = 'CreateWorkspace(OutputWorkspace="ws",DataY="1",DataX="1",NSpec=1' | ||
|
||
alg = prop.value | ||
self.assertTrue(isinstance(alg,IAlgorithm)) | ||
self.assertEquals("CreateWorkspace",alg.name()) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters