Skip to content

Commit

Permalink
#46 add plotting token status to lead view
Browse files Browse the repository at this point in the history
- Adjust unit test to changes
- Bump up package version
  • Loading branch information
serwarde committed Jun 11, 2024
1 parent e4cf8ba commit 6ea5d84
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "inception_reports"
description = "Generate plots that report the progress of an INCEpTION project."
version = "0.5.1"
version = "0.6"
authors = [
{ name = "Serwar", email = "serwar.basch@tu-darmstadt.de" }
]
Expand Down
16 changes: 14 additions & 2 deletions tests/test_generate_reports_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
import os
from unittest.mock import MagicMock, patch

from inception_reports.generate_reports_lead import get_unique_tags, plot_multiples, read_dir
from inception_reports.generate_reports_lead import (
get_unique_tags,
plot_multiples,
read_dir,
)


def test_get_unique_tags():
"""
Test case for the get_unique_tags function.
This test case verifies that the get_unique_tags function returns the expected result
when given a list of projects with tags.
"""
Expand Down Expand Up @@ -105,6 +109,14 @@ def test_plot_project_progress():
"CURATION_FINISHED": 0,
"NEW": 4,
},
"doc_token_categories": {
"ANNOTATION_IN_PROGRESS": 13339,
"ANNOTATION_FINISHED": 0,
"CURATION_IN_PROGRESS": 8092,
"CURATION_FINISHED": 0,
"NEW": 0,
},
"created": "2024-06-11",
}

plot_multiples([project_data], ["tag1", "tag2", "tag3"])
Expand Down
3 changes: 2 additions & 1 deletion tests/test_generate_reports_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ def test_export_data(tmpdir):
"CURATION_IN_PROGRESS": 3,
"CURATION_FINISHED": 7,
},
"created": "2024-06-11"
}

current_date = datetime.now().strftime("%Y_%m_%d")
output_directory = tmpdir.mkdir("output")
export_data(project_data, output_directory)

expected_file_path = os.path.join(output_directory, f"exported_data_{current_date}/{project_data['project_name']}_data_{current_date}.json")
expected_file_path = os.path.join(output_directory, f"exported_data_{current_date}/{project_data['project_name']}_{current_date}.json")
assert os.path.exists(expected_file_path)

with open(expected_file_path, "r") as output_file:
Expand Down

0 comments on commit 6ea5d84

Please sign in to comment.