Пример #1
0
    def test_is_container_terminated(self):
        assert (is_container_terminated(
            status_run_job_event["object"]["status"], container_id="test") is
                None)

        # using wrong container id
        assert (is_container_terminated(
            status_run_job_event_with_conditions["object"]["status"],
            container_id="test",
        ) is None)

        # using correct container id
        assert (is_container_terminated(
            status_run_job_event_with_conditions["object"]["status"],
            container_id="polyaxon-main-job",
        )["exit_code"] == 1)
Пример #2
0
    def test_is_container_terminated_no_status(self):
        status = {"container_statuses": []}
        assert is_container_terminated(status, container_id="test") is None

        status = {"container_statuses": {}}
        assert is_container_terminated(status, container_id="test") is None