def test_with_auth(self):
        auth = Mock()
        result = get_client_settings_args(auth=auth)

        self.assertEqual(result["endpoint_url"], None)
        self.assertEqual(result["timeout"], None)
        self.assertEqual(result["auth"], auth)
Пример #2
0
    def test_with_auth(self):
        auth = Mock()
        result = get_client_settings_args(auth=auth)

        self.assertEqual(result['endpoint_url'], None)
        self.assertEqual(result['timeout'], None)
        self.assertEqual(result['auth'], auth)
Пример #3
0
    def test_no_auth(self):
        result = get_client_settings_args()

        self.assertEqual(result, {
            'endpoint_url': None,
            'timeout': None,
            'auth': None,
        })
Пример #4
0
    def test_username_api_key(self):
        result = get_client_settings_args(username='******',
                                          api_key='api_key',
                                          endpoint_url='http://endpoint/',
                                          timeout=10)

        self.assertEqual(result['endpoint_url'], 'http://endpoint/')
        self.assertEqual(result['timeout'], 10)
        self.assertEqual(result['auth'].username, 'username')
        self.assertEqual(result['auth'].api_key, 'api_key')
Пример #5
0
    def test_username_api_key(self):
        result = config.get_client_settings_args(
            username='******',
            api_key='api_key',
            endpoint_url='http://endpoint/',
            timeout=10,
            proxy='https://localhost:3128')

        self.assertEqual(result['endpoint_url'], 'http://endpoint/')
        self.assertEqual(result['timeout'], 10)
        self.assertEqual(result['username'], 'username')
        self.assertEqual(result['api_key'], 'api_key')
        self.assertEqual(result['proxy'], 'https://localhost:3128')
    def test_username_api_key(self):
        result = config.get_client_settings_args(
            username='******',
            api_key='api_key',
            endpoint_url='http://endpoint/',
            timeout=10,
            proxy='https://localhost:3128')

        self.assertEqual(result['endpoint_url'], 'http://endpoint/')
        self.assertEqual(result['timeout'], 10)
        self.assertEqual(result['username'], 'username')
        self.assertEqual(result['api_key'], 'api_key')
        self.assertEqual(result['proxy'], 'https://localhost:3128')
    def test_username_api_key(self):
        result = get_client_settings_args(
            username="******",
            api_key="api_key",
            endpoint_url="http://endpoint/",
            timeout=10,
            proxy="https://localhost:3128",
        )

        self.assertEqual(result["endpoint_url"], "http://endpoint/")
        self.assertEqual(result["timeout"], 10)
        self.assertEqual(result["auth"].username, "username")
        self.assertEqual(result["auth"].api_key, "api_key")
        self.assertEqual(result["proxy"], "https://localhost:3128")
    def test_no_auth(self):
        result = get_client_settings_args()

        self.assertEqual(result, {"endpoint_url": None, "timeout": None, "proxy": None, "auth": None})