def test_set_deployment_id(self):
     host = 'boo'
     secret = 'baz'
     # The function should return whatever run_with_timeout_returns.
     flexmock(AppControllerClient).should_receive('run_with_timeout')\
       .and_return()
     acc = AppControllerClient(host, secret)
     acc.get_deployment_id()
 def test_set_deployment_id(self):
   host = 'boo'
   secret = 'baz'
   # The function should return whatever run_with_timeout_returns.
   flexmock(AppControllerClient).should_receive('run_with_timeout')\
     .and_return()
   acc = AppControllerClient(host, secret)
   acc.get_deployment_id()
 def test_get_deployment_id(self):
     # The function should return whatever run_with_timeout_returns.
     host = 'boo'
     secret = 'baz'
     deployment_id = 'foo'
     flexmock(AppControllerClient).should_receive('run_with_timeout')\
       .and_return(deployment_id)
     acc = AppControllerClient(host, secret)
     self.assertEqual(deployment_id, acc.get_deployment_id())
 def test_get_deployment_id(self):
   # The function should return whatever run_with_timeout_returns.
   host = 'boo'
   secret = 'baz'
   deployment_id = 'foo'
   flexmock(AppControllerClient).should_receive('run_with_timeout')\
     .and_return(deployment_id)
   acc = AppControllerClient(host, secret)
   self.assertEqual(deployment_id, acc.get_deployment_id())
  def get_deployment_id(cls, head_node, keyname):
    """ Retrieve this AppScale deployment's ID.

    Args:
      head_node: A string containing the IP address of the head node.
      keyname: A string representing the SSH keypair name used for this
        AppScale deployment.
    """
    secret = LocalState.get_secret_key(keyname)
    acc = AppControllerClient(head_node, secret)
    return acc.get_deployment_id()
    def get_deployment_id(cls, head_node, keyname):
        """ Retrieve this AppScale deployment's ID.

    Args:
      head_node: A string containing the IP address of the head node.
      keyname: A string representing the SSH keypair name used for this
        AppScale deployment.
    """
        secret = LocalState.get_secret_key(keyname)
        acc = AppControllerClient(head_node, secret)
        return acc.get_deployment_id()