Skip to content

Commit 2822bdb

Browse files
author
fakhri
committed
New Positive Test Case for Book Endpoint
1 parent 76bbea3 commit 2822bdb

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test_positive_book_endpoint.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import pytest
2+
from endpoints.books import BookEndpoint
3+
4+
5+
6+
def test_multiple_books_endpoint():
7+
books = BookEndpoint()
8+
books.getting_multiple_books()
9+
assert books.checking_status_code() == 201
10+
11+
12+
@pytest.mark.parametrize("bookId", [
13+
1, 2, 3, 4, 5, 6
14+
])
15+
def test_single_books_endpoint(bookId):
16+
books = BookEndpoint()
17+
books.getting_single_book(bookId=bookId)
18+
assert books.checking_status_code() == 200
19+
20+
21+
@pytest.mark.parametrize("type, limit", [
22+
("fiction", ""), ("non-fiction", ""), ("", 3),
23+
("fiction", 2), ("non-ficton", 2)
24+
])
25+
def test_filtering_books(type, limit):
26+
books = BookEndpoint()
27+
books.getting_multiple_books(type=type, limit=limit)
28+
29+
assert books.checking_status_code() == 200

0 commit comments

Comments
 (0)