def test_get_posts_per_page_non_valid_value_used(self):
        _calling_method()
        expected = {"message": "Input payload validation failed",
                    "per_page": "Results per page 3 is not a valid choice"}

        kwargs = {"page": 1,
                  "per_page": 3}

        self.assertTrue(api._verify_posts(expected=expected, **kwargs))
    def test_get_posts_per_page_2(self):
        _calling_method()
        expected = {"items": 2,
                    "page": 1,
                    "pages": 3,
                    "total": 5}

        kwargs = {"page": 1,
                  "per_page": 2}

        self.assertTrue(api._verify_posts(expected=expected, **kwargs))
    def test_get_posts_page_2(self):
        _calling_method()
        expected = {"items": 2,
                    "page": 2,
                    "pages": 3,
                    "total": 5}

        kwargs = {"page": 2,
                  "per_page": 2}

        self.assertTrue(api._verify_posts(expected=expected, **kwargs),
                        "Not displaying posts on page 2 of 3 as expected")
    def test_get_posts_per_page_50(self):
        _calling_method()
        expected = {"items": 50,
                    "page": 1,
                    "pages": 2,
                    "total": 55}

        kwargs = {"page": 1,
                  "per_page": 50}

        api.create_category(name="Test_category", id=4)

        for index in range(expected.get("items")):
            logging.info(f"Post {index}")
            api.create_post(title=f"post {index}", body=f"This is a test body {index}", category_id=4)

        self.assertTrue(api._verify_posts(expected=expected, **kwargs))