Пример #1
0
 def clone(self, obj, content):
     return resume_run(
         run=obj,
         user_id=self.request.user.id,
         content=content,
         message="Run was resumed by user.",
     )
Пример #2
0
    def test_resume_run(self, auditor_record):
        run = resume_run(run=self.run)
        assert auditor_record.call_count == 2
        call_args_list = auditor_record.call_args_list
        assert call_args_list[0][0] == ()
        assert call_args_list[1][0] == ()
        assert call_args_list[0][1]["event_type"] == run_events.RUN_NEW_STATUS
        assert call_args_list[1][1]["event_type"] == run_events.RUN_RESUMED
        assert run.user == self.run.user
        assert run.kind == self.run.kind
        assert run.project == self.run.project
        assert run.name == self.run.name
        assert run.description == self.run.description
        assert run.content == self.run.content
        assert run.raw_content == self.run.raw_content
        assert run.readme == self.run.readme
        assert run.tags == self.run.tags
        assert run.status == V1Statuses.RESUMING
        assert run.cloning_kind is None
        assert run.original is None
        assert run.inputs == {"image": "foo/bar"}

        user = UserFactory()
        run = resume_run(
            run=self.run,
            user_id=user.id,
            name="new-name",
            description="new-description",
            content={"trigger": "all_done"},
            readme="new-readme",
            tags=["tag1", "tag2"],
        )
        assert run.user == user
        assert run.project == self.project
        assert run.name == "new-name"
        assert run.description == "new-description"
        assert run.content == self.run.content
        assert run.raw_content == self.run.raw_content
        assert run.readme == "new-readme"
        assert set(run.tags) == {"tag1", "tag2"}
        assert run.cloning_kind is None
        assert run.original is None
Пример #3
0
 def clone(self, obj, content):
     return resume_run(run=obj, user_id=self.request.user.id, content=content)