mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +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:
@@ -119,7 +119,15 @@ func (s *DownloaderSuite) TestDownloadConnectError(c *C) {
|
||||
ErrorMatches, ".*no such host")
|
||||
}
|
||||
|
||||
func skipIfRoot(c *C) {
|
||||
user := os.Getenv("USER")
|
||||
if user == "root" {
|
||||
c.Skip("Root user")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DownloaderSuite) TestDownloadFileError(c *C) {
|
||||
skipIfRoot(c)
|
||||
c.Assert(s.d.Download(s.ctx, s.url+"/test", "/"),
|
||||
ErrorMatches, ".*permission denied")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user