コード例 #1
0
 def test_get(self):
     coderef = CodeReferenceFactory()
     self.obj.code_reference = coderef
     self.obj.save()
     resp = self.auth_client.get(self.url)
     assert resp.status_code == status.HTTP_200_OK
     assert resp.data == self.serializer_class(coderef).data
コード例 #2
0
    def test_project_ci_code_ref(self):
        project = ProjectFactory()
        repo = ExternalRepoFactory(project=project, git_url='https://github.com/polyaxon/empty.git')
        ci = CIFactory(project=project)
        assert ci.code_reference is None

        code_ref = CodeReferenceFactory(external_repo=repo)
        ci.code_reference = code_ref
        ci.save()
        ci.refresh_from_db()
        assert ci.code_reference == code_ref

        code_ref = CodeReferenceFactory(external_repo=repo)
        ci.code_reference = code_ref
        ci.save()
        ci.refresh_from_db()
        assert ci.code_reference == code_ref
コード例 #3
0
ファイル: test_scheduler.py プロジェクト: yu-iskw/polyaxon
 def setUp(self):
     super().setUp()
     self.project = ProjectFactory()
     self.code_reference = CodeReferenceFactory()
コード例 #4
0
 def test_create_project_with_ci_code_ref(self):
     project = ProjectFactory()
     repo = RepoFactory(project=project)
     code_ref = CodeReferenceFactory(repo=repo)
     ci = CIFactory(project=project, code_reference=code_ref)
     assert ci.code_reference == code_ref