Skip to content

Commit

Permalink
fix linters after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Trevor Blanchard <[email protected]>
  • Loading branch information
ttblanchard committed Jul 4, 2024
1 parent 4da5101 commit 3c09026
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/deadline_test_fixtures/deadline/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def configure_worker_command(
@abc.abstractmethod
def get_worker_id(self) -> str:
raise NotImplementedError("'get_worker_id' was not implemented.")

def userdata(self, s3_files) -> str:
raise NotImplementedError("'userdata' was not implemented.")

Expand Down Expand Up @@ -509,13 +509,13 @@ def ami_ssm_param_name(self) -> str:

def get_worker_id(self) -> str:
cmd_result = self.send_command(
" ; ".join(
[
"$worker=Get-Content -Raw C:\ProgramData\Amazon\Deadline\Cache\worker.json | ConvertFrom-Json",
"echo $worker.worker_id",
]
)
" ; ".join(
[
"$worker=Get-Content -Raw C:\ProgramData\Amazon\Deadline\Cache\worker.json | ConvertFrom-Json",
"echo $worker.worker_id",
]
)
)
assert cmd_result.exit_code == 0, f"Failed to get Worker ID: {cmd_result}"

worker_id = cmd_result.stdout.rstrip("\n\r")
Expand Down
5 changes: 2 additions & 3 deletions test/unit/deadline/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def worker(
ssm_client=boto3.client("ssm"),
deadline_client=boto3.client("deadline"),
configuration=worker_config,
worker_id="worker-7c3377ec9eba444bb51cc7da18463081",
)

@patch.object(mod, "open", mock_open(read_data="mock data".encode()))
Expand Down Expand Up @@ -367,7 +366,7 @@ def test_get_worker_id(self, worker_id: str, worker: PosixInstanceWorker) -> Non
worker, "send_command", return_value=CommandResult(exit_code=0, stdout=worker_id)
):
# WHEN
result = worker.worker_id
result = worker.get_worker_id()

# THEN
assert result == worker_id.rstrip("\n\r")
Expand Down Expand Up @@ -541,7 +540,7 @@ def test_worker_id(self, worker: DockerContainerWorker) -> None:

with patch.object(worker, "send_command", return_value=send_command_result):
# WHEN
result = worker.worker_id
result = worker.get_worker_id()

# THEN
assert result == worker_id

0 comments on commit 3c09026

Please sign in to comment.