mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
add shutdown context unit test
This commit is contained in:
@@ -154,3 +154,13 @@ func (s *DownloaderSuite) TestGetLengthConnectError(c *C) {
|
||||
|
||||
c.Assert(err, ErrorMatches, ".*no such host")
|
||||
}
|
||||
|
||||
func (s *DownloaderSuite) TestContextCancel(c *C) {
|
||||
ctx, cancel := context.WithCancel(s.ctx)
|
||||
s.ctx = ctx
|
||||
|
||||
cancel()
|
||||
_, err := s.d.GetLength(s.ctx, "http://nosuch.host.invalid./")
|
||||
|
||||
c.Assert(err, ErrorMatches, ".*context canceled.*")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user