示例#1
0
def get_beam_jobs() -> List[beam_job_domain.BeamJob]:
    """Returns the list of all registered Apache Beam jobs.

    Returns:
        list(BeamJob). The list of registered Apache Beam jobs.
    """
    return [beam_job_domain.BeamJob(j) for j in jobs_registry.get_all_jobs()]
示例#2
0
    def test_get_all_jobs_returns_value_from_job_metaclass(self) -> None:
        unique_obj = object()

        @classmethod  # type: ignore[misc]
        def get_all_jobs_mock(
                unused_cls: Type[base_jobs.JobMetaclass]) -> object:
            """Returns the unique_obj."""
            return unique_obj

        get_all_jobs_swap = self.swap(base_jobs.JobMetaclass, 'get_all_jobs',
                                      get_all_jobs_mock)

        with get_all_jobs_swap:
            self.assertIs(registry.get_all_jobs(), unique_obj)
示例#3
0
 def test_get_all_jobs_never_returns_an_empty_list(self) -> None:
     self.assertNotEqual(registry.get_all_jobs(), [])