Skip to content

Commit

Permalink
Refactor Tests (#102)
Browse files Browse the repository at this point in the history
* Add test dep on pytest-mock
* Add tests for Archiver class
* Add tests for UnknownArchiver class
* Add tests for ZipArchiver class
* Add basic tests RarArchiver tests
* Refactor tests for Comic class
* Modify Comic class to make attributes private and add properties for path and archiver
* Docstring improvements
* Fix typing for `page_count` attribute
* Fix typing on `path` attribute
* Fix to prevent cycle detected in import chain
  • Loading branch information
bpepple authored Jun 24, 2024
1 parent 26a0979 commit a57b0fd
Show file tree
Hide file tree
Showing 15 changed files with 949 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
docs/darkseid
.git
.idea
.mypy_cache
Expand All @@ -11,4 +12,3 @@ __pycache__
/test-results
.tox
.venv*
docs/darkseid
13 changes: 12 additions & 1 deletion darkseid/archivers/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ def __init__(self: Archiver, path: Path) -> None:
None
"""

self.path = path
self._path = path

@property
def path(self: Archiver) -> Path:
"""
Returns the path associated with the Archiver.
Returns:
Path: The path associated with the Archiver.
"""

return self._path

def read_file(self: Archiver, archive_file: str) -> bytes:
"""
Expand Down
2 changes: 1 addition & 1 deletion darkseid/archivers/rar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import rarfile

from darkseid.archivers import Archiver
from darkseid.archivers.archiver import Archiver
from darkseid.exceptions import RarError


Expand Down
2 changes: 1 addition & 1 deletion darkseid/archivers/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import rarfile

from darkseid.archivers import Archiver
from darkseid.archivers.archiver import Archiver

logger = logging.getLogger(__name__)

Expand Down
Loading

0 comments on commit a57b0fd

Please sign in to comment.