def test_should_update_existing_post(self):
     # given
     post = PostFactory.get_new_post()
     # when
     response = PostService.update_existing_post(post_id=1, post=post)
     # then
     assert PostsAssertions.is_update_post_response_ok(post, response)
 def test_should_add_new_post(self):
     # given
     post = PostFactory.get_new_post()
     # when
     response = PostService.add_new_post(post)
     # then
     assert PostsAssertions.is_add_new_post_response_ok(post, response)
 def test_should_get_all_posts(self):
     # when
     response = PostService.get_all_posts()
     # then
     assert PostsAssertions.is_get_all_posts_response_ok(response)
 def test_should_delete_posts(self):
     # when
     response = PostService.delete_single_post(1)
     # then
     assert PostsAssertions.is_delete_post_response_ok(response)
Exemplo n.º 5
0
def step_impl(context):
    assert PostsAssertions.is_delete_post_response_ok(context.response)
Exemplo n.º 6
0
def step_impl(context):
    assert PostsAssertions.is_update_post_response_ok(context.post,
                                                      context.response)
Exemplo n.º 7
0
def step_impl(context):
    assert PostsAssertions.is_add_new_post_response_ok(context.post,
                                                       context.response)
Exemplo n.º 8
0
def step_impl(context):
    assert PostsAssertions.is_get_all_posts_response_ok(context.response)