HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/samba/tests/samba_tool/__pycache__/timecmd.cpython-310.pyc
o

�/a��@s<ddlZddlmZmZmZddlmZGdd�de�ZdS)�N)�	localtime�strptime�mktime)�SambaToolCmdTestc@s eZdZdZdd�Zdd�ZdS)�TimeCmdTestCasez%Tests for samba-tool time subcommandscCsv|�dtjd�\}}}|�|||d�t|d�}tt|��}ttt���}d}|�|||ko5|||kdf�dS)z;Run time against the server and make sure it looks accurate�time�SERVERzEnsuring time ran successfullyz%a %b %d %H:%M:%S %Y %Z
�zTime is nowN)	�runcmd�os�environ�assertCmdSuccessr�intrr�
assertTrue)�self�result�out�err�timefmt�
servertime�now�delta�r�@/usr/lib/python3/dist-packages/samba/tests/samba_tool/timecmd.py�test_timegets
&zTimeCmdTestCase.test_timegetcCsJ|�dd�\}}}|�|dd�|�|���d�dd�|�|dd�d	S)
z>Run time against a non-existent server, and make sure it failsr�
notaserver���zcheck for result code�NT_STATUS_OBJECT_NAME_NOT_FOUNDzensure right error string�zensure no output returnedN)r
�assertEqual�assertNotEqual�strip�find)rrrrrrr�
test_timefail'szTimeCmdTestCase.test_timefailN)�__name__�
__module__�__qualname__�__doc__rr#rrrrrs
r)rrrrr�samba.tests.samba_tool.baserrrrrr�<module>s