
    5f
                     R    d dl mZ d dlmZ d dlmZ  G d dej                        Zy)    )mock)base)helpersc                       e Zd Zd Zd Zy)LogHelpersTestCasec                 `    G d dt               }t        t        d            }ddd} |       }dD ]n  }t        j                  |      |||d}t        ||      }t        j                  d      5 } ||i | |j                  t        j                  |       d	d	d	       p y	# 1 sw Y   {xY w)
4Test that LOG.debug is called with proper arguments.c                   ^    e Zd Zej                  d        Zeej                  d               Zy)9LogHelpersTestCase.test_log_decorator.<locals>.test_classc                      y N )selfarg1arg2arg3argskwargss         B/usr/lib/python3/dist-packages/oslo_log/tests/unit/test_helpers.pytest_methodzELogHelpersTestCase.test_log_decorator.<locals>.test_class.test_method   s        c                      y r   r   )clsr   r   r   r   r   s         r   test_classmethodzJLogHelpersTestCase.test_log_decorator.<locals>.test_class.test_classmethod        r   N)__name__
__module____qualname__r   log_method_callr   classmethodr   r   r   r   
test_classr      s<    $$ % $$ % r   r!         kwarg1kwarg2)r   r   callermethod_namer   r   logging.Logger.debugN)
objecttupleranger   _get_full_class_namegetattrr   patchassert_called_withANY)	r   r!   r   r   objr)   datamethoddebugs	            r   test_log_decoratorz%LogHelpersTestCase.test_log_decorator   s    	 	 U1X+l> 		9K%:::F#. $&D
 S+.F23 9u''((489 9		99 9s   0)B$$B-	c                    t         j                  d        } G d dt              }dddi d}t        j                  d      5 } |        |j                  t        j                  |       d	d	d	       t        t        d
            }d
dd}dd||d}t        j                  d      5 } |j                  |i | |j                  t        j                  |       d	d	d	       y	# 1 sw Y   zxY w# 1 sw Y   y	xY w)r	   c                       y r   r   r   r   r   _static_methodzHLogHelpersTestCase.test_log_decorator_for_static.<locals>._static_method5   s    r   c                   :    e Zd Zeej
                  d               Zy)DLogHelpersTestCase.test_log_decorator_for_static.<locals>.test_classc                      y r   r   )r   r   r   r   r   s        r   test_staticmethodzVLogHelpersTestCase.test_log_decorator_for_static.<locals>.test_class.test_staticmethod:   r   r   N)r   r   r   staticmethodr   r   r>   r   r   r   r!   r<   9   s"    $$ % r   r!   staticr:   r   r'   r*   Nr"   r#   r$   r>   )
r   r   r+   r   r0   r1   r2   r,   r-   r>   )r   r:   r!   r4   r6   r   r   s          r   test_log_decorator_for_staticz0LogHelpersTestCase.test_log_decorator_for_static2   s     
	 	 	 
!		 	 #/ ZZ./ 	55$$TXXt4	5 U1X+"2 " ZZ./ 	55(J(($9&9$$TXXt4	5 	5	5 	5	5 	5s   (C#'3C/#C,/C8N)r   r   r   r7   rA   r   r   r   r   r      s    985r   r   N)	unittestr   oslotestr   	test_baseoslo_logr   BaseTestCaser   r   r   r   <module>rG      s"     & ;5// ;5r   