
    \e                     F    d dl mZ d dlmZ  G d dej
                        Zy)    )base)versionutilsc                   `    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zy)IsCompatibleTestCasec                     | j                  t        j                  dd             | j                  t        j                  dd             | j                  t        j                  dd             y )N11.01.0.0
assertTruer   is_compatibleselfs    D/usr/lib/python3/dist-packages/oslo_utils/tests/test_versionutils.pytest_same_versionz&IsCompatibleTestCase.test_same_version   sM    223<=225%@A227GDE    c                 N    | j                  t        j                  dd             y )N1.1r	   assertFalser   r   r   s    r   test_requested_minor_greaterz1IsCompatibleTestCase.test_requested_minor_greater   s    33E5ABr   c                 N    | j                  t        j                  dd             y )Nr	   r   r   r   s    r   test_requested_minor_less_thanz3IsCompatibleTestCase.test_requested_minor_less_than   s    225%@Ar   c                 N    | j                  t        j                  dd             y )N1.0.1r
   r   r   s    r   test_requested_patch_greaterz1IsCompatibleTestCase.test_requested_patch_greater!   s    33GWEFr   c                 N    | j                  t        j                  dd             y )Nr
   r   r   r   s    r   test_requested_patch_less_thanz3IsCompatibleTestCase.test_requested_patch_less_than$   s    227GDEr   c                 N    | j                  t        j                  dd             y )Nr	   r
   r   r   s    r   %test_requested_patch_not_present_samez:IsCompatibleTestCase.test_requested_patch_not_present_same'       225'BCr   c                 N    | j                  t        j                  dd             y )Nr	   r   r   r   s    r   *test_requested_patch_not_present_less_thanz?IsCompatibleTestCase.test_requested_patch_not_present_less_than*   r!   r   c                 N    | j                  t        j                  dd             y )Nr
   r	   r   r   s    r   #test_current_patch_not_present_samez8IsCompatibleTestCase.test_current_patch_not_present_same-   s    227EBCr   c                 N    | j                  t        j                  dd             y )Nr   r	   r   r   s    r   (test_current_patch_not_present_less_thanz=IsCompatibleTestCase.test_current_patch_not_present_less_than0   s    33GUCDr   c                     | j                  t        j                  dd             | j                  t        j                  dd             | j                  t        j                  dd             y)z{Even though the current version is 2.0, since `same_major` defaults
        to `True`, 1.0 is deemed incompatible.
        2.0r	   Nr   r   r   r   r   s    r   test_same_major_truez)IsCompatibleTestCase.test_same_major_true3   sS     	33E5AB225%@A33E5ABr   c                     | j                  t        j                  ddd             | j                  t        j                  ddd             | j                  t        j                  ddd             y)zWith `same_major` set to False, then major version compatibiity
        rule is not enforced, so a current version of 2.0 is deemed to satisfy
        a requirement of 1.0.
        r)   r	   F)
same_majorNr*   r   s    r   test_same_major_falsez*IsCompatibleTestCase.test_same_major_false;   sl    
 	33E5?DF 	G225%>CE 	F225%>CE 	Fr   c                 ,   | j                  dt        j                  d             | j                  dt        j                  d             | j                  dt        j                  d             | j                  t        t        j                  d       y )NiP[ z6.2.0i#[ )            )r3   z5a.6b)assertEqualr   convert_version_to_intassertRaises
ValueErrorr   s    r   test_convert_version_to_intz0IsCompatibleTestCase.test_convert_version_to_intG   ss    ,"E"Eg"NO%<<YG	IL??FG*&==w	Hr   c                     | j                  dt        j                  d             | j                  dt        j                  d             y )N6.7.0iب[ 4r1   )r4   r   convert_version_to_strr   s    r   test_convert_version_to_stringz3IsCompatibleTestCase.test_convert_version_to_stringO   s8    ,"E"Eg"NOlAA!DEr   c                    | j                  dt        j                  d             | j                  dt        j                  d             | j                  dt        j                  d             | j                  dt        j                  d             | j                  dt        j                  d             | j                  dt        j                  d             y )N)r0      r   r:   z6.7.0a1z6.7.0alpha1z6.7.0b1z
6.7.0beta1z6.7.0rc1)r4   r   convert_version_to_tupler   s    r   test_convert_version_to_tuplez2IsCompatibleTestCase.test_convert_version_to_tupleS   s    %>>wG	I%>>yI	K%>>}M	O%>>yI	K%>>|L	N%>>zJ	Lr   N)__name__
__module____qualname__r   r   r   r   r   r    r#   r%   r'   r+   r.   r8   r=   rA    r   r   r   r      sV    F
CBGFDDDEC
FHFLr   r   N)oslotestr   	test_base
oslo_utilsr   BaseTestCaser   rE   r   r   <module>rJ      s#     ' #JL911 JLr   