8000 make DefinitionString and DefinitionBody mutually exclusive by tylersouthwick · Pull Request #1390 · cloudtools/troposphere · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

make DefinitionString and DefinitionBody mutually exclusive #1390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/test_serverless.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ def test_required_api_definitionbody(self):
t.add_resource(serverless_api)
t.to_json()

def test_api_no_definition(self):
serverless_api = Api(
"SomeApi",
StageName='test',
)
t = Template()
t.add_resource(serverless_api)
t.to_json()

def test_simple_table(self):
serverless_table = SimpleTable(
"SomeTable"
Expand Down
4 changes: 2 additions & 2 deletions troposphere/serverless.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .awslambda import Environment, VPCConfig, validate_memory_size
from .dynamodb import ProvisionedThroughput, SSESpecification
from .s3 import Filter
from .validators import exactly_one, positive_integer
from .validators import exactly_one, positive_integer, mutually_exclusive
try:
from awacs.aws import PolicyDocument
policytypes = (dict, list, basestring, PolicyDocument)
Expand Down Expand Up @@ -216,7 +216,7 @@ def validate(self):
'DefinitionBody',
'DefinitionUri',
]
exactly_one(self.__class__.__name__, self.properties, conds)
mutually_exclusive(self.__class__.__name__, self.properties, conds)


class PrimaryKey(AWSProperty):
Expand Down
0