horizon/openstack_dashboard/test/unit
Akihiro Motoki 5fd5b4c893 Fix version handling compatible with python-semanticversion 2.8
It seems the behavior of 'partial' argument of Version class __init__
has been changed between semantic-version 2.6.0 and 2.8.1
(though I could not identify the root cause).
'partial' argument is marked as deprecated in semantic-vesion 2.7.0,
so it is a good chance not to depend on 'partial' argument in horizon.

This commit uses Version.coerce() [1] instead to convert non-semver
version into a valid semver version.
We also need to keep the original version information as it is passed
when initializing python-*client (cinderclient and keystoneclient).

In addition, the previous implementation based on semantic-version 2.6.0
returns True for "Version("3.55") == 3". It depends on the behavior
of "partial" argument of semantic_version.Version. It was not
documented and it looks tricky to depend on this behavior.
"major" and "minor" properties are now introduced and api/cinder.py
is updated accordingly. I believe this approach is clearer and stable.

Unit test coverage on dict behavior is improved.
Variable names in the unit tests are adjusted to more meaningful ones.

[1] https://python-semanticversion.readthedocs.io/en/latest/#coercing-an-arbitrary-version-string

Change-Id: If0deee9d0289ff91d58d942b9612f7736356ae18
2019-09-09 15:54:26 +09:00
..
api Fix version handling compatible with python-semanticversion 2.8 2019-09-09 15:54:26 +09:00
usage Merge "quota: Move targets argument to get_disabled_quotas" 2018-05-16 16:59:31 +00:00
utils Refactor futurist calls 2018-03-14 21:15:52 +02:00
__init__.py openstack_dashboard: Move test files to match module structure 2017-12-09 21:38:06 +09:00
test_error_pages.py openstack_dashboard: Move test files to match module structure 2017-12-09 21:38:06 +09:00
test_policy.py Sync keystone policy 2018-01-26 04:01:05 +09:00
test_themes.py Do not load openstack_dashboard.settings in unit tests 2018-12-28 23:06:38 +09:00
test_views.py Fix Angular errors in openstack_auth 2018-03-17 18:36:01 +09:00