Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
  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()
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
 def setUp(self):
     self.hostname = 'hostname'
     self.port = None
     self.client = client.SimianClient(self.hostname)
Ejemplo n.º 5
0
 def setUp(self):
   mox.MoxTestBase.setUp(self)
   self.stubs = stubout.StubOutForTesting()
   self.hostname = 'hostname'
   self.port = None
   self.client = client.SimianClient(self.hostname)