def testInitWithHostname(self): """Test __init__() with a hostname passed.""" user = '******' with mock.patch.object(client.SimianClient, '_GetLoggedOnUser', return_value=user): clienttmp = client.SimianClient('foo') self.assertEqual(clienttmp.hostname, 'foo') self.assertEqual(clienttmp._user, user)
def testInitWithHostname(self): """Test __init__() with a hostname passed.""" user = '******' self.mox.StubOutWithMock( client.SimianClient, '_GetLoggedOnUser', self.mox.CreateMockAnything()) client.SimianClient._GetLoggedOnUser().AndReturn(user) self.mox.ReplayAll() clienttmp = client.SimianClient('foo') self.assertEqual(clienttmp.hostname, 'foo') self.assertEqual(clienttmp._user, user) self.mox.VerifyAll()
def GetSimianClientInstance(self, *args, **kwargs): """Returns an instance of the Simian client to use within this CLI. CLI subclasses should override this if necessary. """ return client.SimianClient(*args, **kwargs)
def setUp(self): self.hostname = 'hostname' self.port = None self.client = client.SimianClient(self.hostname)
def setUp(self): mox.MoxTestBase.setUp(self) self.stubs = stubout.StubOutForTesting() self.hostname = 'hostname' self.port = None self.client = client.SimianClient(self.hostname)