Add method for mocking Entrypoint in a specified namespace

This commit is contained in:
Antoni Rościszewski 2017-02-02 08:49:47 +01:00
parent 2a57fb841e
commit 7539f71aed
2 changed files with 6 additions and 2 deletions

View File

@ -36,7 +36,7 @@ func (d dummyResolver) GetName() (name string) {
func init() {
testClient = mocks.NewClient()
testEntrypoint = mocks.NewEntrypoint(testClient, testNamespace)
testEntrypoint = mocks.NewEntrypointInNamespace(testNamespace)
}

View File

@ -20,9 +20,13 @@ func (m MockEntrypoint) GetNamespace() (namespace string) {
return m.namespace
}
func NewEntrypoint(client cli.ClientInterface, namespace string) MockEntrypoint {
func NewEntrypointInNamespace(namespace string) MockEntrypoint {
return MockEntrypoint{
client: client,
namespace: namespace,
}
}
func NewEntrypoint() MockEntrypoint {
return NewEntrypointInNamespace("test")
}