Skip to content

Commit b551a6b

Browse files
TEST: Updating tests
1 parent b9f4666 commit b551a6b

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

tests/integration/test_artifact.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,32 @@
44

55
import pytest
66

7-
from botcity.maestro import AutomationTask, BotMaestroSDK
7+
from botcity.maestro import Artifact, AutomationTask, BotMaestroSDK
88

99

1010
def test_post_artifact(maestro: BotMaestroSDK, file: str, task: AutomationTask):
11-
maestro.post_artifact(
11+
artifact_name = "My Artifact.txt"
12+
response = maestro.post_artifact(
1213
task_id=task.id,
13-
artifact_name="My Artifact",
14+
artifact_name=artifact_name,
1415
filepath=file
1516
)
1617

18+
artifact = Artifact.from_json(response.payload)
19+
assert artifact.name == artifact_name
20+
21+
22+
def test_post_artifact_without_file_extension(maestro: BotMaestroSDK, file: str, task: AutomationTask):
23+
artifact_name = "My Artifact"
24+
response = maestro.post_artifact(
25+
task_id=task.id,
26+
artifact_name=artifact_name,
27+
filepath=file
28+
)
29+
30+
artifact = Artifact.from_json(response.payload)
31+
assert artifact.name == f"{artifact_name}.txt"
32+
1733

1834
@pytest.mark.depends(name="test_post_artifact")
1935
def test_list_artifacts(maestro: BotMaestroSDK):

0 commit comments

Comments
 (0)