Skip to content

Commit

Permalink
Rebase into infrastructure...
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Oct 11, 2024
1 parent 129dfad commit 93fd43d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3412,8 +3412,13 @@ def containing(self, expected_contents: str) -> Self:
)
return self

assert_contains = containing
assert_has_contents = with_contents
# aliases that might help make tests more like English in particular cases. Declaring them explicitly
# instead quick little aliases because of https://github.com/python/mypy/issues/6700
def assert_contains(self, expected_contents: str) -> Self:
return self.containing(expected_contents)

def assert_has_contents(self, expected_contents: str) -> Self:
return self.with_contents(expected_contents)


class DescribeJob:
Expand All @@ -3429,6 +3434,7 @@ def _wait_for(self):
self._dataset_populator.wait_for_job(self._job_id, assert_ok=False)
self._final_details = self._dataset_populator.get_job_details(self._job_id).json()

@property
def final_details(self) -> Dict[str, Any]:
self._wait_for()
final_details = self._final_details
Expand All @@ -3450,7 +3456,7 @@ def with_final_state(self, expected_state: str) -> Self:
return self

@property
def with_single_output(self):
def with_single_output(self) -> DescribeToolExecutionOutput:
return self.with_output(0)

def with_output(self, output: Union[str, int]) -> DescribeToolExecutionOutput:
Expand All @@ -3469,8 +3475,12 @@ def with_output(self, output: Union[str, int]) -> DescribeToolExecutionOutput:
raise AssertionError(f"Could not find job output identified by {output}")
return DescribeToolExecutionOutput(self._dataset_populator, self._history_id, dataset_id)

assert_has_output = with_output
assert_has_single_output = with_single_output
# aliases that might help make tests more like English in particular cases.
def assert_has_output(self, output: Union[str, int]) -> DescribeToolExecutionOutput:
return self.with_output(output)

def assert_has_single_output(self, output: Union[str, int]) -> DescribeToolExecutionOutput:
return self.with_single_output


class DescribeFailure:
Expand Down

0 comments on commit 93fd43d

Please sign in to comment.