forked from Silverfish/proton-bridge
GODT-1523: Reduce unnecessary shell executions. Inspired by @kortschak.
This commit is contained in:
@ -175,5 +175,6 @@ func (ctx *TestContext) MessagePreparationFinished(username string) {
|
||||
}
|
||||
|
||||
func (ctx *TestContext) CredentialsFailsOnWrite(shouldFail bool) {
|
||||
ctx.credStore.(*fakeCredStore).failOnWrite = shouldFail //nolint:forcetypeassert
|
||||
ctx.credStore.(*fakeCredStore).failOnWrite = shouldFail //nolint:forcetypeassert
|
||||
ctx.addCleanup(func() { ctx.credStore.(*fakeCredStore).failOnWrite = false }, "credentials-cleanup") //nolint:forcetypeassert
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ type fakeCredStore struct {
|
||||
|
||||
// newFakeCredStore returns a fake credentials store (optionally configured with the given credentials).
|
||||
func newFakeCredStore(initCreds ...*credentials.Credentials) (c *fakeCredStore) {
|
||||
c = &fakeCredStore{credentials: map[string]*credentials.Credentials{}}
|
||||
c = &fakeCredStore{credentials: map[string]*credentials.Credentials{}, failOnWrite: false}
|
||||
for _, creds := range initCreds {
|
||||
if creds == nil {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user