def test_missing_field(self): event = { "RequestType": RequestType.CREATE, "ResponseURL": "https://test.url", "StackId": None, "RequestId": None, "ResourceType": None, } self.assertFalse(is_valid_event(event))
def test_missing_physical(self): event = { "RequestType": RequestType.UPDATE, "ResponseURL": "https://test.url", "StackId": None, "RequestId": None, "ResourceType": None, "LogicalResourceId": None } self.assertFalse(is_valid_event(event))
def test_invalid_url(self): event = { "RequestType": RequestType.CREATE, "ResponseURL": "ftp://test.url", "StackId": None, "RequestId": None, "ResourceType": None, "LogicalResourceId": None } self.assertFalse(is_valid_event(event))
def test_no_valid_request_type(self): event = { "RequestType": "DESTROY", "ResponseURL": "https://test.url", "StackId": None, "RequestId": None, "ResourceType": None, "LogicalResourceId": None } self.assertFalse(is_valid_event(event))
def test_included_physical(self): event = { "RequestType": RequestType.DELETE, "ResponseURL": "https://test.url", "StackId": None, "RequestId": None, "ResourceType": None, "LogicalResourceId": None, "PhysicalResourceId": None } self.assertTrue(is_valid_event(event))