Skip to content

Commit

Permalink
test: Test the survey_name parameter of import_survey (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored May 29, 2024
1 parent 4eebf4a commit 2bd680e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/integration/test_rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io
import json
import operator
import random
import typing as t
import uuid
from datetime import datetime
Expand Down Expand Up @@ -160,6 +161,25 @@ def test_survey(client: citric.Client):
assert new_props["format"] == enums.NewSurveyType.ALL_ON_ONE_PAGE


@pytest.mark.integration_test
def test_import_survey(client: citric.Client, subtests: SubTests):
"""Test importing a survey with a custom ID and name."""
survey_id = random.randint(10000, 20000) # noqa: S311
with Path("./examples/survey.lss").open("rb") as f:
imported_id = client.import_survey(
f,
survey_id=survey_id,
survey_name="Custom Name",
)

with subtests.test(msg="imported survey has custom ID"):
assert imported_id == survey_id

survey_props = client.get_language_properties(imported_id)
with subtests.test(msg="imported survey has custom name"):
assert survey_props["surveyls_title"] == "Custom Name"


@pytest.mark.integration_test
def test_copy_survey_destination_id(
request: pytest.FixtureRequest,
Expand Down

0 comments on commit 2bd680e

Please sign in to comment.