Files
python-cinderclient/cinderclient/tests/unit
Gorka Eguileor 8b5a772e36 Make APIVersion's null check more pythonic
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).

While this works it is not very pythonic, since you have to write
expressions such as:

 if not min_version and not max_version:
     return True
 elif ((min_version and max_version) and
       max_version.is_null() and min_version.is_null()):
     return True

This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.

So previous code would just look like:

 if not min_version and not max_version:
     return True

Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.

Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d
2016-08-29 11:41:57 +02:00
..
2016-07-23 07:35:40 +10:00
2016-02-24 13:46:39 -06:00
2016-07-26 18:59:30 +00:00
2016-07-23 07:35:40 +10:00
2016-07-23 07:35:40 +10:00