-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bounds and default for node-agent configuration key/value pairs (#14
- Loading branch information
Showing
6 changed files
with
66 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from unittest import TestCase | ||
from inbm_common_lib.validater import ConfigurationItem, configuration_bounds_check | ||
|
||
|
||
class TestValidater(TestCase): | ||
|
||
def setUp(self): | ||
self.item = ConfigurationItem('RegistrationRetry Timer Secs', 1, 60, 20) | ||
|
||
def test_return_value_when_within_limits(self) -> None: | ||
self.assertEquals(30, configuration_bounds_check(self.item, 30)) | ||
|
||
def test_return_default_when_below_lower_limit(self) -> None: | ||
self.assertEquals(20, configuration_bounds_check(self.item, 0)) | ||
|
||
def test_return_default_when_above_upper_limit(self) -> None: | ||
self.assertEquals(20, configuration_bounds_check(self.item, 61)) |
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