Skip to content

Commit f8437ee

Browse files
committed
Fixed test issues
1 parent cbe81bc commit f8437ee

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

tests/data_review_tool/test_article_review.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# ensure that the parent directory is on the path for relative imports
88
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
99

10+
os.environ["ARTICLE_RELEVANCE_BATCH"] = "article-relevance-output.parquet"
11+
os.environ["ENTITY_EXTRACTION_BATCH"] = "entity-extraction-output.zip"
12+
1013
from src.data_review_tool.app import *
1114
from src.data_review_tool.pages.article_review import *
1215

@@ -22,20 +25,6 @@ def test_cell_clicked():
2225
assert cell_clicked(0) == dash.no_update
2326

2427

25-
def test_directory_structure():
26-
"Test that the directory structure is as expected."
27-
dir = "data/data-review-tool"
28-
expected = ["processed", "raw"]
29-
assert expected[0] in os.listdir(dir) and expected[1] in os.listdir(dir)
30-
31-
32-
def test_find_start_end_char():
33-
"Test that the find_start_end_char function returns the correct values."
34-
text = "This is a test"
35-
entity = "test"
36-
assert find_start_end_char(text, entity) == (10, 14)
37-
38-
3928
def test_update_button():
4029
"Test that the update_button function returns correct children for Delete or Restore."
4130
assert update_button(True)[0].children == "Delete Entity"

tests/data_review_tool/test_home.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,15 @@
1010

1111
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
1212

13+
os.environ["ARTICLE_RELEVANCE_BATCH"] = "article-relevance-output.parquet"
14+
os.environ["ENTITY_EXTRACTION_BATCH"] = "entity-extraction-output.zip"
15+
1316
# Import the names of callback functions you want to test
1417
from src.data_review_tool.app import *
1518
from src.data_review_tool.pages.home import *
1619
from src.data_review_tool.pages.config import *
1720

1821

19-
def test_directory_structure():
20-
"test that the data directory structure is correct"
21-
dir = "data/data-review-tool"
22-
expected = ["processed", "raw"]
23-
24-
assert expected[0] in os.listdir(dir) and expected[1] in os.listdir(dir)
25-
26-
2722
def test_current_article_clicked():
2823
"test that clicking 'Review' button redirects to the correct article"
2924
active_cell_current = AttributeDict({"row": 0, "column_id": "Review"})

0 commit comments

Comments
 (0)