Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Create step should not require step_id #125

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class BaseStepRequest(JsonModel):
step_id: str
step_id: Optional[str]
"""Step ID."""

result_id: str
Expand Down
39 changes: 39 additions & 0 deletions tests/integration/testmonitor/test_testmonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,45 @@ def test__create_single_step__creation_succeed(
assert created_step.inputs == inputs
assert not created_step.outputs

def test__create_step_without_step_id__creation_succeed(
self,
client: TestMonitorClient,
create_results,
create_steps,
):
results = [
CreateResultRequest(
part_number="Python Client Testing",
program_name="Python Client Test Program",
status=Status.PASSED(),
)
]
created_result = create_results(results)
result_id = created_result.results[0].id
name = "Test Step 1"
data = StepData(
text="This is a test step",
parameters=[Measurement(name="param1", measurement="10")],
)
properties = {"property1": "value1", "property2": "value2"}
keywords = ["keyword1", "keyword2"]
inputs = [NamedValue(name="input1", value="inputValue1")]
step = CreateStepRequest(
result_id=result_id,
name=name,
data=data,
properties=properties,
keywords=keywords,
inputs=inputs,
)

response: CreateStepsPartialSuccess = create_steps(steps=[step])

assert response is not None
assert len(response.steps) == 1
created_step = response.steps[0]
assert created_step.step_id is not None

def test__create_multiple_steps__multiple_creation_succeed(
self, client: TestMonitorClient, create_results, create_steps
):
Expand Down