Skip to content

Commit

Permalink
Check
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil25803 committed Jun 10, 2024
1 parent ef9b7a7 commit 04e2041
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/scrape_up/librarygenesis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .library import LibGen

__all__ = ["LibGen"]
__all__ = ["LibGen"]
7 changes: 3 additions & 4 deletions src/test/banners_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


class TestScraper88x31(unittest.TestCase):

def setUp(self):
"""
Initialize a Scraper88x31 instance before each test method.
Expand All @@ -12,9 +11,9 @@ def setUp(self):

def test_get_all(self):
"""
| Methods | Details |
| ------------------ | -------------------------------------------------------- |
| `get_all()` | Returns the list of all available 88x31 banners |
| Methods | Details |
| ------------------ | -------------------------------------------------------- |
| `get_all()` | Returns the list of all available 88x31 banners |
"""
try:
banners = self.scraper.get_all()
Expand Down
29 changes: 21 additions & 8 deletions src/test/librarygenesis_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import unittest
from src.scrape_up.librarygenesis import LibGen
from scrape_up.librarygenesis import LibGen


class TestLibGen(unittest.TestCase):
"""
| Methods | Details |
| --------------| ----------------------------- |
| `.getBooks(book_name=" ")` | Returns the books with name, author, size, format, book link, book cover link, language |
"""
| Methods | Details |
| --------------| ----------------------------- |
| `.getBooks(book_name=" ")` | Returns the books with name, author, size, format, book link, book cover link, language |
"""

def setUp(self):
"""
Initialize a LibGen instance before each test method.
Expand All @@ -20,7 +21,11 @@ def test_getBooks_empty_name(self):
"""
try:
result = self.libgen.getBooks("")
self.assertEqual(result, "Error: enter name", "Expected error message for empty book name")
self.assertEqual(
result,
"Error: enter name",
"Expected error message for empty book name",
)
except:
return None

Expand All @@ -30,7 +35,11 @@ def test_getBooks_short_name(self):
"""
try:
result = self.libgen.getBooks("AI")
self.assertEqual(result, "Error: Title Too Short", "Expected error message for short book name")
self.assertEqual(
result,
"Error: Title Too Short",
"Expected error message for short book name",
)
except:
return None

Expand Down Expand Up @@ -58,7 +67,11 @@ def test_getBooks_no_results(self):
"""
try:
result = self.libgen.getBooks("somebookthatdoesnotexist")
self.assertEqual(result, "Error: no results found", "Expected error message for no results found")
self.assertEqual(
result,
"Error: no results found",
"Expected error message for no results found",
)
except:
return None

Expand Down

0 comments on commit 04e2041

Please sign in to comment.