Skip to content

Commit b542e83

Browse files
committed
fixed fmt issues
1 parent fb0c217 commit b542e83

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

examples/stack_deployment_step.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ def main() -> None:
5858
"--address", default=os.getenv("TFE_ADDRESS", "https://app.terraform.io")
5959
)
6060
parser.add_argument("--token", default=os.getenv("TFE_TOKEN"))
61-
parser.add_argument(
62-
"--run-id", required=True, help="Deployment run ID (sdr-...)"
63-
)
61+
parser.add_argument("--run-id", required=True, help="Deployment run ID (sdr-...)")
6462
parser.add_argument("--step-id", help="Deployment step ID (sds-...)")
6563
parser.add_argument("--page-size", type=int, default=20)
6664
parser.add_argument(
@@ -88,7 +86,12 @@ def main() -> None:
8886
)
8987
parser.add_argument(
9088
"--artifact",
91-
choices=["plan-description", "apply-description", "plan-debug-log", "apply-debug-log"],
89+
choices=[
90+
"plan-description",
91+
"apply-description",
92+
"plan-debug-log",
93+
"apply-debug-log",
94+
],
9295
help="Download an artifact (requires --step-id)",
9396
)
9497
parser.add_argument(
@@ -107,7 +110,9 @@ def main() -> None:
107110
includes.append(StackDeploymentStepIncludeOpt.STACK_APPROVAL)
108111
if args.include_state:
109112
includes.append(StackDeploymentStepIncludeOpt.STACK_STATE)
110-
opts = StackDeploymentStepListOptions(page_size=args.page_size, include=includes or None)
113+
opts = StackDeploymentStepListOptions(
114+
page_size=args.page_size, include=includes or None
115+
)
111116
count = 0
112117
for step in client.stack_deployment_steps.list(args.run_id, options=opts):
113118
count += 1
@@ -172,7 +177,9 @@ def main() -> None:
172177
print("--step-id is required for --artifact")
173178
else:
174179
artifact_type = StackDeploymentStepArtifactType(args.artifact)
175-
_print_header(f"Downloading artifact '{args.artifact}' for step: {args.step_id}")
180+
_print_header(
181+
f"Downloading artifact '{args.artifact}' for step: {args.step_id}"
182+
)
176183
content = client.stack_deployment_steps.download_artifact(
177184
args.step_id, artifact_type
178185
)

src/pytfe/resources/stack_deployment_steps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ def _stack_deployment_step_from(
206206
included=included,
207207
)
208208
)
209-
return attach_jsonapi(
210-
StackDeploymentStep.model_validate(attrs), data, included
211-
)
209+
return attach_jsonapi(StackDeploymentStep.model_validate(attrs), data, included)
212210

213211
def _stack_diagnostic_from(
214212
self,

tests/units/test_stack_deployment_step.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ def test_list_diagnostics_empty(self, service):
267267
def test_download_artifact_invalid_id_raises(self, service):
268268
"""download_artifact() with an empty ID raises InvalidStackDeploymentStepIDError."""
269269
with pytest.raises(InvalidStackDeploymentStepIDError):
270-
service.download_artifact("", StackDeploymentStepArtifactType.PLAN_DESCRIPTION)
270+
service.download_artifact(
271+
"", StackDeploymentStepArtifactType.PLAN_DESCRIPTION
272+
)
271273

272274
def test_download_artifact_returns_bytes(self, service, mock_transport):
273275
"""download_artifact() returns the raw response bytes."""

0 commit comments

Comments
 (0)