Skip to content

Commit 929279d

Browse files
committed
Improve export test
1 parent b886fe8 commit 929279d

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.pylintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[MASTER]
2+
load-plugins=pylint_pytest
3+
14
[TYPECHECK]
25
generated-members=
36
numpy.* ,torch.* ,cv2.* , cv.*, sh.*

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pip install -e .
1919
# pip install superannotate
2020

2121
# for testing
22-
pip install pytest pytest-xdist coverage pytest-cov pylint pylint-json2html
22+
pip install pytest pytest-xdist coverage pytest-cov pylint pylint-json2html pylint-pytest
2323

2424
# for docs
2525
pip install sphinx sphinx_rtd_theme

tests/test_get_exports.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
from pathlib import Path
2-
import json
3-
4-
import pytest
52

63
import superannotate as sa
74

8-
PROJECT_NAME = "test_get_exports"
5+
PROJECT_NAME1 = "test_get_exports1"
96

107

118
def test_get_exports(tmpdir):
129
tmpdir = Path(tmpdir)
1310

14-
projects_found = sa.search_projects(PROJECT_NAME, return_metadata=True)
11+
projects_found = sa.search_projects(PROJECT_NAME1, return_metadata=True)
1512
for pr in projects_found:
1613
sa.delete_project(pr)
17-
project = sa.create_project(PROJECT_NAME, "gg", "Vector")
14+
project = sa.create_project(PROJECT_NAME1, "gg", "Vector")
1815
sa.upload_images_from_folder_to_project(
1916
project,
2017
"./tests/sample_project_vector/",
@@ -28,8 +25,14 @@ def test_get_exports(tmpdir):
2825
project,
2926
"./tests/sample_project_vector/",
3027
)
28+
exports_old = sa.get_exports(project)
29+
3130
export = sa.prepare_export(project)
32-
sa.download_export(project, export, tmpdir)
31+
sa.download_export(project, export["name"], tmpdir)
3332
js = list(tmpdir.glob("*.json"))
3433

3534
assert len(js) == 4
35+
36+
exports_new = sa.get_exports(project)
37+
38+
assert len(exports_new) == len(exports_old) + 1

0 commit comments

Comments
 (0)