-
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.
Refs #4399. Add other declareProperty overloads.
- Loading branch information
1 parent
5c04f6d
commit 08f0edb
Showing
12 changed files
with
187 additions
and
54 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
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
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
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
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
30 changes: 30 additions & 0 deletions
30
Code/Mantid/Framework/PythonInterface/test/python/PythonAlgorithmPropertiesTest.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,30 @@ | ||
import unittest | ||
|
||
from mantid import PythonAlgorithm, Direction | ||
|
||
class BasicPropsAlg(PythonAlgorithm): | ||
|
||
def PyInit(self): | ||
self.declareProperty('SimpleInput', 1) | ||
self.declareProperty('SimpleOutput', 1.0, Direction.Output) | ||
|
||
def PyExec(self): | ||
pass | ||
|
||
# ====================================================================== | ||
|
||
class PythonAlgorithmPropertiesTest(unittest.TestCase): | ||
|
||
def test_simple_property_declarations_have_correct_attrs(self): | ||
alg = BasicPropsAlg() #AlgorithmManager.Instance().createUnmanaged("TestPyAlgDeclaringProps") | ||
props = alg.getProperties() | ||
self.assertEquals(0, len(props)) | ||
alg.initialize() | ||
props = alg.getProperties() | ||
self.assertEquals(2, len(props)) | ||
|
||
input = alg.getProperty("SimpleInput") | ||
self.assertEquals(input.direction, Direction.Input) | ||
output = alg.getProperty("SimpleOutput") | ||
self.assertEquals(output.direction, Direction.Output) | ||
|
Oops, something went wrong.