ovh / python-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing.
https://pypi.org/project/ovh/
Other
297 stars 81 forks source link

Unit tests fail on debian 9 preventing simple debian 9 packaging. #54

Closed osynge closed 2 years ago

osynge commented 6 years ago

When you run the following code block on debian 8 everything works, but on debian 9 it fails.

python setup.py --command-packages=stdeb.command sdist_dsc
cd deb_dist/
cd `find -type d | find -type d | head -n 2 | tail -n 1`
pwd
debuild -uc -us

Notably:

test_endpoints (tests.test_client.testClient)
...
ERROR
test_init_from_custom_config (tests.test_client.testClient)
...
ERROR
test_config_get_conf (tests.test_config.testConfig)
...
FAIL
test_config_get_conf_env_rules_them_all (tests.test_config.testConfig)
...
ok
test_config_get_custom_conf (tests.test_config.testConfig)
...
FAIL
test_real_lookup_path (tests.test_config.testConfig)
...

And drilling down:

======================================================================
ERROR: test_endpoints (tests.test_client.testClient)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_client.py", line 403, in test_endpoints
auth_time = Client(endpoint).get('/auth/time', _need_auth=False)
File "ovh/client.py", line 346, in get
return self.call('GET', _target, None, _need_auth)
File "ovh/client.py", line 414, in call
raise HTTPError("Low HTTP request failed error", error)
HTTPError: ('Low HTTP request failed error', ConnectionError(MaxRetryError("HTTPSConnectionPool(host='ca.api.kimsufi.com', port=443): Max retries exceeded with url: /1.0/auth/time (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<ovh.vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f176ae9a550>: Failed to establish a new connection: [Errno 111] Connection refused',)))",),))
======================================================================
ERROR: test_init_from_custom_config (tests.test_client.testClient)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_client.py", line 111, in test_init_from_custom_config
api = Client(config_file=M_CUSTOM_CONFIG_PATH)
File "ovh/client.py", line 164, in __init__
endpoint, ENDPOINTS.keys())
InvalidRegion: ('Unknow endpoint %s. Valid endpoints: %s', None, ['kimsufi-ca', 'kimsufi-eu', 'soyoustart-eu', 'ovh-ca', 'ovh-eu', 'soyoustart-ca'])
======================================================================
FAIL: test_config_get_conf (tests.test_config.testConfig)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_config.py", line 73, in test_config_get_conf
self.assertEqual('soyoustart-ca', conf.get('default', 'endpoint'))
AssertionError: 'soyoustart-ca' != None
======================================================================
FAIL: test_config_get_custom_conf (tests.test_config.testConfig)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_config.py", line 100, in test_config_get_custom_conf
self.assertEqual('ovh-ca', conf.get('default', 'endpoint'))
AssertionError: 'ovh-ca' != None
======================================================================
FAIL: test_real_lookup_path (tests.test_config.testConfig)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_config.py", line 68, in test_real_lookup_path
], self._orig_CONFIG_PATH)
AssertionError: Lists differ: ['/etc/ovh.conf', '/home/jenki... != ['/etc/ovh.conf', '/home/jenki...
First differing element 2:
demik commented 4 years ago

Just in case someone hit this too, a little bit of dirty hacking is needed:

rbeuque74 commented 2 years ago

Hello, Thanks for your issue. This has been fixed in #110. Released in https://github.com/ovh/python-ovh/releases/tag/v1.0.0

Have a great day