-
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.
Export ArrayBoundedValidator. Refs #4399
- Loading branch information
1 parent
233e406
commit 49edeef
Showing
13 changed files
with
33 additions
and
73 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
44 changes: 0 additions & 44 deletions
44
Code/Mantid/Framework/PythonInterface/mantid/kernel/validators.py
This file was deleted.
Oops, something went wrong.
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: 11 additions & 11 deletions
22
Code/Mantid/Framework/PythonInterface/test/python/BoundedValidatorTest.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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import unittest | ||
import testhelpers | ||
from mantid import BoundedValidator | ||
from mantid import FloatBoundedValidator, IntBoundedValidator | ||
|
||
class BoundedValidatorTest(object): | ||
|
||
def test_construction_does_not_raise_error_when_both_are_floats(self): | ||
testhelpers.assertRaisesNothing(self, BoundedValidator, 1.0, 2.0) | ||
testhelpers.assertRaisesNothing(self, FloatBoundedValidator, 1.0, 2.0) | ||
|
||
def test_construction_does_not_raise_error_when_both_are_ints(self): | ||
testhelpers.assertRaisesNothing(self, BoundedValidator, 1, 20) | ||
|
||
def test_construction_raises_error_when_called_with_no_params(self): | ||
self.assertRaises(TypeError, BoundedValidator()) | ||
testhelpers.assertRaisesNothing(self, IntBoundedValidator, 1, 20) | ||
|
||
def test_construction_with_lower_sets_only_lower(self): | ||
validator = BoundedValidator(lower=1) | ||
validator = FloatBoundedValidator() | ||
lower = 1.4 | ||
validator.setLower(lower) | ||
self.assertEquals(validator.hasLower(), True) | ||
self.assertEquals(validator.hasUpper(), False) | ||
self.assertEquals(validator.lower(), 1) | ||
self.assertEquals(validator.lower(), lower) | ||
|
||
def test_construction_with_upper_sets_only_upper(self): | ||
validator = BoundedValidator(upper=5.0) | ||
validator = FloatBoundedValidator() | ||
upper = 5.4 | ||
validator.setUpper(upper) | ||
self.assertEquals(validator.hasUpper(), True) | ||
self.assertEquals(validator.hasLower(), False) | ||
self.assertEquals(validator.upper(), 5.0) | ||
|
||
self.assertEquals(validator.upper(), upper) | ||
|
||
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