-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: moved e2e according to user type
- Loading branch information
1 parent
ece2d63
commit 9392828
Showing
19 changed files
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import uuid | ||
|
||
import pytest | ||
|
||
from kili.client import Kili | ||
|
||
|
||
@pytest.fixture() | ||
def project_id(kili: Kili): | ||
project_id = kili.create_project( | ||
input_type="TEXT", json_interface={"jobs": {}}, title="test_tags.py e2e admin SDK" | ||
)["id"] | ||
|
||
yield project_id | ||
|
||
kili.delete_project(project_id) | ||
|
||
|
||
def test_given_org_with_tags_when_i_update_tag_then_it_is_updated(kili: Kili): | ||
# Given | ||
org_tags = kili.tags(fields=("label",)) | ||
assert len(org_tags) > 0, "Organization has no tags" | ||
tag_to_update = next(tag for tag in org_tags if tag["label"]) | ||
prev_tag_name = tag_to_update["label"] | ||
|
||
# When | ||
new_tag_name = str(uuid.uuid4()) | ||
kili.update_tag(tag_name=prev_tag_name, new_tag_name=new_tag_name) | ||
|
||
# Then | ||
org_tags = kili.tags(fields=("label",)) | ||
assert len(org_tags) > 0, "Organization has no tags" | ||
assert new_tag_name in [tag["label"] for tag in org_tags] | ||
|
||
# Cleanup | ||
kili.update_tag(tag_name=new_tag_name, new_tag_name=prev_tag_name) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.