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/__pycache__/dsdb_dns.cpython-310.pyc
o

�/a;
�@sLddlmZddlmZddlZdd�Zdd�Zdd	�ZGd
d�de�ZdS)�)�TestCase)�dsdb_dnsNcCs<|dkr|S|dkrdS|dkrdS|d7}|d9}t|�S)N��������rl!l
g�cA)�int)�t�r�6/usr/lib/python3/dist-packages/samba/tests/dsdb_dns.py�unix2nttimesr
cCs$t|�}|dkr|d7}|td�S)Nrl�Ј� B)r
r)r�ntrrr	�unix2dns_timestamp#sr
cCs |td�}|dkrtd��|S)Nrlznt time won't fit this)r�
OverflowError)�tsrrrr	�timestamp2nttime+src@seZdZdd�Zdd�ZdS)�DsdbDnsTestCasecCs4gd�}|D]}t|�}t�|�}|�||�qdS)N)i��^`�rri@)r
r�unix_to_dns_timestamp�assertEqual)�self�	unixtimesr�expected�resultrrr	�test_unix_to_dns_timestamp3s
�z*DsdbDnsTestCase.test_unix_to_dns_timestampc
Cs�dddddtd�td�dg}|D]A}d}zt|�}Wnty&d}Ynwzt�|�}WntyA|�|d	|�d
��Yqw|�|d	|�d��|�||�qdS)Niɵ�rrl��rga�տ��AFTz
timestamp z should not overflowz should overflow)	rrrr�dns_timestamp_to_nt_time�
ValueError�
assertTrue�assertFalser)r�
timestampsr�	overflowsrrrrr	�test_dns_timestamp_to_nt_time?s0
�	���z-DsdbDnsTestCase.test_dns_timestamp_to_nt_timeN)�__name__�
__module__�__qualname__rr rrrr	r2sr)	�samba.testsr�sambar�timer
r
rrrrrr	�<module>s