HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //lib/python3.6/site-packages/tracer/tests/__pycache__/test_views.cpython-36.opt-1.pyc
3

�|
`'�
@s&ddlmZddlTddlmZddlmZddlmZddl	m
Z
mZddlm
Z
dd	lmZdd
lmZmZddlZddlZddlZddlZejdd
dgd�ZejZyddlmZWnddlmZYnXeejj_eejj_eejj _Gdd�de!j"�Z#Gdd�de$�Z%Gdd�de$�ZdS)�)�unicode_literals�)�*)�StringIO)�DefaultView)�
HelperView)�Applications�Application)�ApplicationsCollection)�Package)�ProcessMock�AffectedProcessMockN�tracerTZen)ZfallbackZ	languages)�patchc@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
eddd�dd��ZdS)�	TestViewscCst�|_dS)N)r�out)�self�r� /usr/lib/python3.6/test_views.py�setUp#szTestViews.setUpcCsFt|j�}|jdt��|jdtg��|j�|j|jj�d�dS)N�args�applications�)rr�assign�ArgsMockr
�render�assertEqual�getvalue)r�viewrrr�test_default_none&s

zTestViews.test_default_nonec
Cspt|j�}|jdt��|jdttdddd��tdddd��tdddd��g��|j�|j|jj�d�dS)	Nrr�applicationzfirst helper)�type�helper�namez
second helperzthird helperzkYou should restart:
  * Some applications using:
      first helper
      second helper
      third helper
)	rrrrr
r	rrr)rrrrr�test_default_with_helpers-s
z#TestViews.test_default_with_helpersc
Cspt|j�}|jdt��|jdttdddd��tdddd��tdddd��g��|j�|j|jj�d�dS)	Nrrr �foo)r!r#r"�bar�bazzSYou should restart:
  * These applications manually:
      bar
      baz
      foo
)	rrrrr
r	rrr)rrrrr�test_default_without_helpers>s
z&TestViews.test_default_without_helpersc
Cs�t|j�}|jdt��|jdttdddd��tdddd��tdddd��tdddd	��tdd
dd	��tdddd	��g��|j�|j|jj�d�dS)
Nrrr zfirst helper)r!r"r#z
second helperzthird helperr%)r!r#r"r&r'z�You should restart:
  * Some applications using:
      first helper
      second helper
      third helper

  * These applications manually:
      bar
      baz
      foo
)	rrrrr
r	rrr)rrrrr�!test_default_with_without_helpersOs
z+TestViews.test_default_with_without_helpersc
Cstt|j�}|jdtdd��|jdttdddd��tdd	d
d��tdddd��g��|j�|j|jj�d
�dS)NrT)�allr�sessionr%�h1)r!r#r"r&�h2r'�h3zbYou should restart:
  * These applications restarting your session:
      bar
      baz
      foo
)	rrrrr
r	rrr)rrrrr�test_default_all_sessionhs
z"TestViews.test_default_all_sessionc
Cstt|j�}|jdtdd��|jdttdddd��tdd	d
d��tdddd��g��|j�|j|jj�d
�dS)NrT)r*r�staticr%r,)r!r#r"r&r-r'r.zbYou should restart:
  * These applications rebooting your computer:
      bar
      baz
      foo
)	rrrrr
r	rrr)rrrrr�test_default_all_staticys
z!TestViews.test_default_all_staticc
Cs�t|j�}|jdtdd��|jdttdddd��tdd	d
d��tdddd��td
ddd��td
ddd��td
ddd��g��|j�|j|jj�d�dS)NrT)r*rr+r%r,)r!r#r"r&r-r'r.r0�aaa�h4�bbbZh5ZcccZh6z�You should restart:
  * These applications restarting your session:
      bar
      baz
      foo

  * These applications rebooting your computer:
      aaa
      bbb
      ccc
)	rrrrr
r	rrr)rrrrr�test_default_all_session_static�s
z)TestViews.test_default_all_session_staticcCs�t|j�}|jdtdd��|jdttdddd��tdddd��tdd	dd
��tdddd
��tdd
dd
��tdddd
��tdddd
��tdddd
��g��|j�|j|jj�d�dS)NrT)r*rr zfirst helper)r!r"r#z
second helperr%)r!r#r"r&r+r'r,�quxr-r0r2r.r4r3aYou should restart:
  * Some applications using:
      first helper
      second helper

  * These applications manually:
      bar
      foo

  * These applications restarting your session:
      baz
      qux

  * These applications rebooting your computer:
      aaa
      bbb
)	rrrrr
r	rrr)rrrrr�test_default_all�s
zTestViews.test_default_allcCs�t|j�}|jdt��|jdttdddd��tdddd��tdddd��tdd	dd��td
ddd��td
d
dd��tdddd��g��|j�|j|jj�d�dS)Nrrr zfirst helper)r!r"r#z
second helperr%)r!r#r"r&r+r'r,r6r-r0r2r.a!You should restart:
  * Some applications using:
      first helper
      second helper

  * These applications manually:
      bar
      foo

Additionally, there are:
  - 2 processes requiring restart of your session (i.e. Logging out & Logging in again)
  - 1 processes requiring reboot
)	rrrrr
r	rrr)rrrrr�test_default_not_all�s
zTestViews.test_default_not_allc
Cspt|j�}|jdt��|jdttdddd��tdddd��td	d
dd��g��|j�|j|jj�d�dS)
Nrrr+r%r,)r!r#r"r&r-r0r'r.z�There are:
  - 2 processes requiring restart of your session (i.e. Logging out & Logging in again)
  - 1 processes requiring reboot
)	rrrrr
r	rrr)rrrrr�test_default_note_only�s
z TestViews.test_default_note_onlyz0tracer.resources.applications.System.init_systemZdummy)Zreturn_valuecCs�tdddddg�tdddddg�g}td	�}d|_d
|_d|_ddg|_td�}t|g�|_|g}t	|j
�}|jdtdd
��|jd|�|jdt
jd��|jd|�|jd|�|jdd�|j�|j|j
j�d�dS)N�r%i�Zfile1Zfile2�i.Zfile3Z
foopackagezFoo package descriptionZcategr)�verbose�	processesr �package�affected_byZaffectsa;* foo
    Package:     foopackage
    Description: Foo package description
    Type:        Application
    State:       foo has been started by None some-time ago. PID - 2
                 foo has been started by None some-time ago. PID - 3

    Affected by:
        foopackage
            file1
            file2
)rrZmodified�description�category�filesr
�setZpackagesrrrrr�findrrr)rZinit_systemr=r>Za1r?rrrr�test_helper�s(

zTestViews.test_helperN)�__name__�
__module__�__qualname__rrr$r(r)r/r1r5r7r8r9rrErrrrr!s!rc@seZdZdZZddd�ZdS)rNFcCs||_||_||_||_dS)N)r*�quiet�userr<)rr*rIrJr<rrr�__init__szArgsMock.__init__)FFFF)rFrGrHr*rIrKrrrrrsrc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rcCs(d|_||_||_||_||_d|_dS)Nz	some-time)�parent�pidrB�_name�_create_timeZstr_started_ago)rrMr#�create_timerBrrrrK"szProcessMock.__init__cCs|jS)N)rN)rrrrr#*szProcessMock.namecCs|jS)N)rO)rrrrrP-szProcessMock.create_timecCsgS)Nr)rrrr�children0szProcessMock.childrencCsdS)Nr)rrrr�username3szProcessMock.usernameN)rFrGrHrKr#rPrQrRrrrrr!s
r)&Z
__future__rZ__meta__Ztracer.resources.pycomprZtracer.views.defaultrZtracer.views.helperrZtracer.resources.applicationsrr	Ztracer.resources.collectionsr
Ztracer.resources.packagerZtest_tracerrr
rZtracer.views.note_for_hidden�gettextZtranslation�tZugettext�_Z
unittest.mockrZmockZviews�defaultr"Znote_for_hiddenZunittestZTestCaser�objectrrrrr�<module>s2


w