Skip to content

Commit

Permalink
updated test file and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
WD-Scott committed Aug 14, 2024
1 parent 820559c commit ecaa75d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ drop_temp_downloads:

# Job to run tests
.PHONY: test
test: drop_temp_downloads
test:
pytest tests -vvx
Binary file modified tests/.DS_Store
Binary file not shown.
7 changes: 3 additions & 4 deletions tests/test_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os
import shutil
import pytest
from pkg_cleaner import make_unique, config, scan_create, scan_new, MoverHandler
from pkg_cleaner import make_unique, config, scan_create, MoverHandler

dst = '/Downloads/'
FLDRS = ["Images", "Videos", "Audio", "Documents", "Coding"]
Expand Down Expand Up @@ -56,7 +56,7 @@ def mock_downloads_dir(tmpdir_factory):
os.makedirs(os.path.join(mock_dir, subdir))

for file_name in test_files:
with open(os.path.join(mock_dir, file_name), 'w') as f:
with open(os.path.join(mock_dir, file_name), 'w', encoding='utf-8') as f:
f.write("test")

yield mock_dir
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_process(mock_downloads_dir):
'''
config['source_dir'] = str(mock_downloads_dir)
config['directories'] = {folder: os.path.join(str(mock_downloads_dir), folder)\
for folder in config['directories'].keys()}
for folder in config['directories']}

handler = MoverHandler()
handler.process()
Expand All @@ -146,4 +146,3 @@ def test_process(mock_downloads_dir):
for file in files:
assert any(file.endswith(ext) for ext in config['extensions'][category]),\
f"File {file} in {directory} does not have the correct extension"

0 comments on commit ecaa75d

Please sign in to comment.