in jetbrains-core/tst/software/aws/toolkits/jetbrains/services/lambda/sam/SamCommonTest.kt [138:176]
fun getCodeUri_samAndNotSam() {
val file = yamlTemplate(
"""
Description: "Some description"
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: hello_world/
Handler: app.handle_request
Runtime: java8
MyDynamoTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: "ArtistId"
AttributeType: "S"
- AttributeName: "Concert"
AttributeType: "S"
KeySchema:
- AttributeName: "ArtistId"
KeyType: "HASH"
- AttributeName: "Concert"
KeyType: "RANGE"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
""".trimIndent()
)
createChildren("hello_world")
runReadAction {
val dir = file.containingDirectory.virtualFile
val templateFile = SamCommon.getTemplateFromDirectory(dir)
assertNotNull(templateFile)
val codeUris = SamCommon.getCodeUrisFromTemplate(projectRule.project, templateFile)
assertEquals(1, codeUris.size)
assertEquals("hello_world", codeUris[0].name)
}
}