github.com/cloudfoundry-attic/ltc@v0.0.0-20151123212628-098adc7919fc/docker_runner/docker_metadata_fetcher/fake_docker_session/fake_docker_session_factory.go (about) 1 // This file was generated by counterfeiter 2 package fake_docker_session 3 4 import ( 5 "sync" 6 7 "github.com/cloudfoundry-incubator/ltc/docker_runner/docker_metadata_fetcher" 8 ) 9 10 type FakeDockerSessionFactory struct { 11 MakeSessionStub func(reposName string, allowInsecure bool) (docker_metadata_fetcher.DockerSession, error) 12 makeSessionMutex sync.RWMutex 13 makeSessionArgsForCall []struct { 14 reposName string 15 allowInsecure bool 16 } 17 makeSessionReturns struct { 18 result1 docker_metadata_fetcher.DockerSession 19 result2 error 20 } 21 } 22 23 func (fake *FakeDockerSessionFactory) MakeSession(reposName string, allowInsecure bool) (docker_metadata_fetcher.DockerSession, error) { 24 fake.makeSessionMutex.Lock() 25 fake.makeSessionArgsForCall = append(fake.makeSessionArgsForCall, struct { 26 reposName string 27 allowInsecure bool 28 }{reposName, allowInsecure}) 29 fake.makeSessionMutex.Unlock() 30 if fake.MakeSessionStub != nil { 31 return fake.MakeSessionStub(reposName, allowInsecure) 32 } else { 33 return fake.makeSessionReturns.result1, fake.makeSessionReturns.result2 34 } 35 } 36 37 func (fake *FakeDockerSessionFactory) MakeSessionCallCount() int { 38 fake.makeSessionMutex.RLock() 39 defer fake.makeSessionMutex.RUnlock() 40 return len(fake.makeSessionArgsForCall) 41 } 42 43 func (fake *FakeDockerSessionFactory) MakeSessionArgsForCall(i int) (string, bool) { 44 fake.makeSessionMutex.RLock() 45 defer fake.makeSessionMutex.RUnlock() 46 return fake.makeSessionArgsForCall[i].reposName, fake.makeSessionArgsForCall[i].allowInsecure 47 } 48 49 func (fake *FakeDockerSessionFactory) MakeSessionReturns(result1 docker_metadata_fetcher.DockerSession, result2 error) { 50 fake.MakeSessionStub = nil 51 fake.makeSessionReturns = struct { 52 result1 docker_metadata_fetcher.DockerSession 53 result2 error 54 }{result1, result2} 55 } 56 57 var _ docker_metadata_fetcher.DockerSessionFactory = new(FakeDockerSessionFactory)