コード例 #1
0
ファイル: test_shell.py プロジェクト: wputra/MOS-centos
 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()
コード例 #2
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()
コード例 #3
0
ファイル: test_shell.py プロジェクト: wputra/MOS-centos
 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)
コード例 #4
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)
コード例 #5
0
ファイル: test_shell.py プロジェクト: wputra/MOS-centos
    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
コード例 #6
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
コード例 #7
0
ファイル: test_shell.py プロジェクト: wputra/MOS-centos
 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)
コード例 #8
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)