Пример #1
0
    def test_request_get(self):
        task = self._create_task(init_repos=False)
        tid = task["id"]
        initial_create(tid, GIT_URL, 1, self.user)
        response = get(tid, self.user)

        self.assertTrue(response["status"]["value"], "not sync")
Пример #2
0
 def test_push_and_request_get(self):
     task = self._create_task(init_repos=False)
     tid = task["id"]
     initial_create(tid, GIT_URL, 1, self.user)
     self.add_file(task["repos_path"], "file.txt")
     push(tid, self.user, "", "")
     response = get(tid, self.user)
     self.assertTrue(response["status"]["value"], "merged")
     self.assertIsNone(response["status"]["error"])
Пример #3
0
def get_repository(request, tid):
    try:
        slogger.task[tid].info("get repository request")
        return JsonResponse(CVATGit.get(tid, request.user))
    except Exception as ex:
        with contextlib.suppress(Exception):
            slogger.task[tid].error(
                "error occurred during getting repository info request",
                exc_info=True)

        return HttpResponseBadRequest(str(ex))