示例#1
0
 def test_empty(self):
     # No endpoint or auth_url is configured for client.
     # client.discover() should be called without parameters
     self.client_mock.endpoint = False
     self.client_mock.auth_url = False
     shell.do_discover(self.client_mock, args=None)
     self.client_mock.discover.assert_called_with()
 def test_empty(self):
     # No endpoint or auth_url is configured for client.
     # client.discover() should be called without parameters
     self.client_mock.endpoint = False
     self.client_mock.auth_url = False
     shell.do_discover(self.client_mock, args=None)
     self.client_mock.discover.assert_called_with()
示例#3
0
 def test_auth_url(self):
     # No endpoint provided for client, but there is an auth_url
     # client's discover method should be called with auth_url value
     self.client_mock.endpoint = False
     self.client_mock.auth_url = 'Some non-empty value'
     shell.do_discover(self.client_mock, args=None)
     self.client_mock.discover.assert_called_with(self.client_mock.auth_url)
 def test_auth_url(self):
     # No endpoint provided for client, but there is an auth_url
     # client's discover method should be called with auth_url value
     self.client_mock.endpoint = False
     self.client_mock.auth_url = 'Some non-empty value'
     shell.do_discover(self.client_mock, args=None)
     self.client_mock.discover.assert_called_with(self.client_mock.auth_url)
示例#5
0
    def _execute_discover(self):
        """Call do_discover function and capture output

        :return: captured output is returned
        """
        with mock.patch('sys.stdout',
                        new_callable=moves.StringIO) as mock_stdout:
            shell.do_discover(self.client_mock, args=None)
            output = mock_stdout.getvalue()
        return output
    def _execute_discover(self):
        """Call do_discover function and capture output

        :return: captured output is returned
        """
        with mock.patch('sys.stdout',
                        new_callable=moves.StringIO) as mock_stdout:
            shell.do_discover(self.client_mock, args=None)
            output = mock_stdout.getvalue()
        return output
示例#7
0
 def test_endpoint(self):
     # Endpoint is configured for client,
     # client's discover method should be called with that value
     self.client_mock.endpoint = 'Some non-empty value'
     shell.do_discover(self.client_mock, args=None)
     self.client_mock.discover.assert_called_with(self.client_mock.endpoint)
 def test_endpoint(self):
     # Endpoint is configured for client,
     # client's discover method should be called with that value
     self.client_mock.endpoint = 'Some non-empty value'
     shell.do_discover(self.client_mock, args=None)
     self.client_mock.discover.assert_called_with(self.client_mock.endpoint)