-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
109 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import unittest | ||
|
||
from troposphere.appconfig import DeploymentStrategy, Validators | ||
|
||
|
||
class TestAppconfigDeploymentStrategy(unittest.TestCase): | ||
def test_deploymentstrategy_growthtype_bad_value(self): | ||
with self.assertRaisesRegex(ValueError, "GrowthType must be one of"): | ||
DeploymentStrategy( | ||
"DeploymentStrategy", | ||
DeploymentDurationInMinutes=1, | ||
GrowthFactor=1, | ||
GrowthType="LINEA", | ||
Name="DeploymentStrategy", | ||
ReplicateTo="NONE", | ||
) | ||
|
||
def test_deploymentstrategy_replicateto_bad_value(self): | ||
with self.assertRaisesRegex(ValueError, "ReplicateTo must be one of"): | ||
DeploymentStrategy( | ||
"DeploymentStrategy", | ||
DeploymentDurationInMinutes=1, | ||
GrowthFactor=1, | ||
Name="DeploymentStrategy", | ||
ReplicateTo="none", | ||
) | ||
|
||
def test_deploymentstrategy(self): | ||
for replicate_to in ("NONE", "SSM_DOCUMENT"): | ||
DeploymentStrategy( | ||
"DeploymentStrategy", | ||
DeploymentDurationInMinutes=1, | ||
GrowthFactor=1, | ||
GrowthType="LINEAR", | ||
Name="DeploymentStrategy", | ||
ReplicateTo=replicate_to, | ||
) | ||
|
||
|
||
class TestAppconfigValidators(unittest.TestCase): | ||
def test_validators_type_bad_value(self): | ||
with self.assertRaisesRegex(ValueError, "Validator Type must be one of"): | ||
Validators(Type="JSON_SCHEM") | ||
|
||
def test_validators_type(self): | ||
for validator_type in ("JSON_SCHEMA", "LAMBDA"): | ||
Validators(Type=validator_type) |
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,16 @@ | ||
import unittest | ||
|
||
from troposphere.dlm import CreateRule | ||
|
||
|
||
class TestDlmCreateRule(unittest.TestCase): | ||
def test_createrule_interval_bad_value(self): | ||
with self.assertRaisesRegex(ValueError, "Interval must be one of"): | ||
CreateRule("CreateRule", Interval=25) | ||
|
||
def test_createrule_intervalunit_bad_value(self): | ||
with self.assertRaisesRegex(ValueError, "Interval unit must be one of"): | ||
CreateRule("CreateRule", Interval=24, IntervalUnit="HOUR") | ||
|
||
def test_createrule(self): | ||
CreateRule("CreateRule", Interval=24, IntervalUnit="HOURS") |
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