This file contains hidden or 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
| import inspect | |
| class Pact(object): | |
| has_pact_with = None | |
| state = None | |
| def __str__(self): | |
| return "\n==> Provider Pact\n\tHas pact with: " + str(self.has_pact_with) + "\n\tState: " + str(self.state) | |
This file contains hidden or 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
| import pytest | |
| from pytest_pact.utils.pytest_utils import read_marker | |
| @pytest.hookimpl(hookwrapper=True) | |
| def pytest_pyfunc_call(pyfuncitem): | |
| state = read_marker(pyfuncitem, 'state') | |
| print(state) | |
| outcome = yield | |
| res = outcome.get_result() |
This file contains hidden or 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
| import calculator | |
| def test_answer(mocker): | |
| mocker.patch.object(calculator, 'sum') | |
| calculator.sum.return_value = 123 | |
| assert calculator.sum(2, 3) == 123 |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Serverless Guestbook</title> | |
| <script src="https://code.jquery.com/jquery-3.1.1.min.js" type="text/javascript"> | |
| </script> | |
| <script type="text/javascript"> | |
| const get_url = 'https://tfh1cxol33.execute-api.ap-southeast-2.amazonaws.com/serverlessguestbookdeployment' | |
| const post_url = 'https://tfh1cxol33.execute-api.ap-southeast-2.amazonaws.com/serverlessguestbookdeployment' | |
| const list_messages = (messages) => { for (m of messages) $('#list').append(format(m)) } |
This file contains hidden or 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
| (function () { | |
| 'use strict'; | |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json') | |
| }); | |
| grunt.task.loadTasks('./tasks'); |
This file contains hidden or 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
| Files: | |
| - MonitoringStackName: my-stack | |
| BucketName: my-bucket | |
| Filename: my-file | |
| TopicName: my-topic | |
| AlarmName: my-alarm | |
| AlarmProtocol: email | |
| AlarmEndpoint: "my.name@example.com" |
This file contains hidden or 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
| Description: Monitoring Stack | |
| Parameters: | |
| TopicName: | |
| Description: Name for the SNS topic used for the monitoring | |
| Type: String | |
| AlarmName: | |
| Description: Name for the CloudWatch alarm | |
| Type: String |
This file contains hidden or 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
| Resources: | |
| S3ConfigurationUpdater: | |
| Type: "Custom::S3ConfigurationUpdater" | |
| Properties: | |
| ServiceToken: !GetAtt [ LambdaFunction, Arn ] |
This file contains hidden or 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
| LambdaFunction: | |
| Type: "AWS::Lambda::Function" | |
| DependsOn: SNSTopic | |
| Properties: | |
| Description: "Lambda function to modify the existing S3 bucket" | |
| Handler: index.handler | |
| Runtime: "nodejs4.3" | |
| Timeout: 300 | |
| Role: !GetAtt [ LambdaFunctionRole, Arn ] | |
| Code: |
This file contains hidden or 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
| # frozen_string_literal: true | |
| require 'docker_logger' | |
| module Utils | |
| class Logger | |
| def self.instance | |
| RequestIdentityLogger | |
| end | |
| end |