mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-22 11:08:20 +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:
1 parent
370e3cdfea
commit
6826efc723
4 files changed
+41
-4
No files matched your search
@@ -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