Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit b358722

Browse files
yasakova-anastasiamikhail-treskin
authored andcommitted
Add test to remove project data (cvat-ai#5752)
- Added test to remove project data (cvat-ai#5632)
1 parent 6d7fcc2 commit b358722

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Tracks can be exported/imported to/from Datumaro and Sly Pointcloud formats (<ht
6767
- Export annotations to Azure container (<https://github.com/opencv/cvat/pull/5596>)
6868
- Fix the type of the credentials parameter of make_client from the Python SDK
6969
- Reduced number of noisy information on ortho views for 3D canvas (<https://github.com/opencv/cvat/pull/5608>)
70-
- Clean up disk space after a project is removed (<https://github.com/opencv/cvat/pull/5632>)
70+
- Clean up disk space after a project is removed (<https://github.com/opencv/cvat/pull/5632>, <https://github.com/opencv/cvat/pull/5752>)
7171
- Submit button is locked while file is not selected when importing a dataset (<https://github.com/opencv/cvat/pull/5757>)
7272
- \[Server API\] Various errors in the generated schema (<https://github.com/opencv/cvat/pull/5575>)
7373
- SiamMask and TransT serverless functions (<https://github.com/opencv/cvat/pull/5658>)

cvat/apps/engine/tests/test_rest_api.py

+22
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,28 @@ def test_api_v2_projects_id_somebody(self):
956956
def test_api_v2_projects_id_no_auth(self):
957957
self._check_api_v2_projects_id(None)
958958

959+
def test_api_v2_projects_delete_project_data_after_delete_project(self):
960+
tasks = {}
961+
for project in self.projects:
962+
tasks[project.name] = create_dummy_db_tasks(self.__class__, project)
963+
964+
project_dir = project.get_dirname()
965+
self.assertTrue(os.path.exists(project_dir))
966+
967+
for task in tasks[project.name]:
968+
task_dir = task.get_dirname()
969+
self.assertTrue(os.path.exists(task_dir))
970+
971+
self._check_api_v2_projects_id(self.admin)
972+
973+
for project in self.projects:
974+
project_dir = project.get_dirname()
975+
self.assertFalse(os.path.exists(project_dir))
976+
977+
for task in tasks[project.name]:
978+
task_dir = task.get_dirname()
979+
self.assertFalse(os.path.exists(task_dir))
980+
959981
class ProjectCreateAPITestCase(APITestCase):
960982
def setUp(self):
961983
self.client = APIClient()

0 commit comments

Comments
 (0)