Beispiel #1
0
    def test_main_ok_like_2(self):
        params = {'pathParameters': {'article_id': 'testidlike02'}}

        article_liked_user = ArticlesLikesShow(event=params,
                                               context={},
                                               dynamodb=self.dynamodb)
        response = article_liked_user.main()

        self.assertEqual(response['statusCode'], 200)
        self.assertEqual(json.loads(response['body'])['count'], 2)
def lambda_handler(event, context):
    articles_likes_get = ArticlesLikesShow(event=event,
                                           context=context,
                                           dynamodb=dynamodb)
    return articles_likes_get.main()
Beispiel #3
0
    def assert_bad_request(self, params):
        test_function = ArticlesLikesShow(params, {}, self.dynamodb)
        response = test_function.main()

        self.assertEqual(response['statusCode'], 400)