mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-13 14:59:03 +00:00
Don't give rate limit delay when project is not found
This commit is contained in:
@@ -899,6 +899,26 @@ func TestTaskChainCausesConflict(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskAssignInvalidDoesntGiveRateLimit(t *testing.T) {
|
||||
|
||||
task := getTaskFromProject(13247, testWorker)
|
||||
|
||||
if task.RateLimitDelay != 0 {
|
||||
t.Error()
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskSubmitInvalidDoesntGiveRateLimit(t *testing.T) {
|
||||
|
||||
resp := createTask(api.SubmitTaskRequest{
|
||||
Recipe: " ",
|
||||
Project: 133453,
|
||||
}, testWorker)
|
||||
|
||||
if resp.RateLimitDelay != 0 {
|
||||
t.Error()
|
||||
}
|
||||
}
|
||||
func createTask(request api.SubmitTaskRequest, worker *storage.Worker) (ar api.JsonResponse) {
|
||||
r := Post("/task/submit", request, worker, nil)
|
||||
UnmarshalResponse(r, &ar)
|
||||
|
||||
Reference in New Issue
Block a user