mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-09 10:57:55 +00:00
test(jfrog): cover JFrog storage init error path and fix branch lint/coverage hygiene
This commit is contained in:
committed by
André Roth
parent
7a2a82c60e
commit
9502f3833f
@@ -124,3 +124,28 @@ func (s *AptlyContextSuite) TestGetPublishedStorageJFrogMissing(c *C) {
|
||||
FatalErrorPanicMatches,
|
||||
&FatalError{ReturnCode: 1, Message: "published JFrog storage missing not configured"})
|
||||
}
|
||||
|
||||
func (s *AptlyContextSuite) TestGetPublishedStorageJFrogInitError(c *C) {
|
||||
prevConfig := utils.Config
|
||||
defer func() { utils.Config = prevConfig }()
|
||||
|
||||
s.context.configLoaded = true
|
||||
utils.Config.JFrogPublishRoots = map[string]utils.JFrogPublishRoot{
|
||||
"broken": {
|
||||
Repository: "aptly-repo",
|
||||
Url: "ssh://example.local/artifactory",
|
||||
},
|
||||
}
|
||||
|
||||
defer func() {
|
||||
obtained := recover()
|
||||
c.Assert(obtained, NotNil)
|
||||
|
||||
fatalErr, ok := obtained.(*FatalError)
|
||||
c.Assert(ok, Equals, true)
|
||||
c.Check(fatalErr.ReturnCode, Equals, 1)
|
||||
c.Check(fatalErr.Message, Matches, `error creating jfrog manager: .*`)
|
||||
}()
|
||||
|
||||
s.context.GetPublishedStorage("jfrog:broken")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user