Skip to content

Commit 105ea60

Browse files
committed
I hope it's last time
1 parent d004acf commit 105ea60

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/tests/test_read_docs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import pytest
2+
import os
23
from src.file_processor import FileProcessor
34

45
def test_read_docx():
56
file_processor = FileProcessor()
6-
with open("../../data/input/fanatyk.docx", "rb") as file:
7+
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../data/input"))
8+
file_path = os.path.join(base_dir, "fanatyk.docx")
9+
with open(file_path, "rb") as file:
710
file_processor.file = file
811
file_processor.file_type = ".txt"
912
content = file_processor._read_docx

app/tests/test_read_pdf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import pytest
2+
import os
23
from src.file_processor import FileProcessor
34

45

56
def test_read_pdf():
67
file_processor = FileProcessor()
7-
with open("../../data/input/fanatyk.pdf", "rb") as file:
8+
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../data/input"))
9+
file_path = os.path.join(base_dir, "fanatyk.pdf")
10+
with open(file_path, "rb") as file:
811
file_processor.file = file
912
file_processor.file_type = ".pdf"
1013
content = file_processor._read_pdf()

0 commit comments

Comments
 (0)