mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-06 05:30:57 +00:00
Fix pure-go unittests
So they can run on e.g. LXC containers as root, or other conceivable setups.
This commit is contained in:
@@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aptly-dev/aptly/task"
|
||||
|
||||
@@ -44,6 +45,8 @@ func (s *TaskSuite) TestTaskDelete(c *C) {
|
||||
response, _ := s.HTTPRequest("POST", "/api/tasks-dummy?_async=true", nil)
|
||||
c.Check(response.Code, Equals, 202)
|
||||
c.Check(response.Body.String(), Equals, "{\"Name\":\"Dummy task\",\"ID\":1,\"State\":0}")
|
||||
// Give the task time to start
|
||||
time.Sleep(time.Second)
|
||||
response, _ = s.HTTPRequest("DELETE", "/api/tasks/1", nil)
|
||||
c.Check(response.Code, Equals, 200)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user