Пример #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)
Пример #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()
Пример #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)
Пример #4
0
 def setUp(self):
     self.hostname = 'hostname'
     self.port = None
     self.client = client.SimianClient(self.hostname)
Пример #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)