OwlCyberSecurity - MANAGER
Edit File: test_fs_scanner.cpython-311.pyc
� E�\h[ � �6 � d Z ddlmZ G d� d� � Zd� ZdS )u This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> � )� HashesMatcherc � � e Zd Zd� ZdS )�DummyDBc �N � g | _ G d� d� � } || � � | _ d S )Nc � � e Zd Zd� Zd� ZdS )�$DummyDB.__init__.<locals>.DummyTablec � � || _ d S �N)�outer)�selfr s �]/opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/fs_scanner/test_fs_scanner.py�__init__z-DummyDB.__init__.<locals>.DummyTable.__init__ s � �"�� � � � c �D � | j j � |� � d S r )r �inserted�append)r �rows r �buffered_insertz4DummyDB.__init__.<locals>.DummyTable.buffered_insert! s! � �� �#�*�*�3�/�/�/�/�/r N)�__name__� __module__�__qualname__r r � r r � DummyTabler s2 � � � � � � #� #� #� 0� 0� 0� 0� 0r r )r �hashes_matches)r r s r r zDummyDB.__init__ sK � ��� � 0� 0� 0� 0� 0� 0� 0� 0� )�j��.�.����r N)r r r r r r r r r s# � � � � � � /� /� /� /� /r r c � � �� d}| dz }|� |� � | dz � � � d� � | dz ��� d� � G � �fd�d� � }t t |� � � � }t � � }|� t � � � d| |� � � � }|� t �� � d| |� � � � }|� t | d z � � d | |� � � � }|� t �� � d| |� � � � } |d u sJ �|d u sJ �|du sJ �| du sJ �t |j � � dk sJ �|j d t � � � dddd fk sJ �|j d t �� � ddddfk sJ �d S )Nz�1:1000:deadbeef:0 2:2000:goodhash1:0 2:2001:goodhash2:2 7:3000:deadbeef2:0 8:4000:deadbeef3:0 2:2002:goodhash3:1 2:2002:goodhash3:1 �hashesz file1.txt�data1z file2.txt�data2c � �� e Zd Zd� �fd� ZdS )�Dtest_hashes_matcher_filters_and_matches.<locals>.DummyHashCalculatorFc �\ �� |t �� � k rdS |t �� � k rdS dS )N� goodhash1� goodhash3�nope)�str)r �path�apply_normalization�file1�file2s ��r � calc_hashzNtest_hashes_matcher_filters_and_matches.<locals>.DummyHashCalculator.calc_hash: s4 �� ��s�5�z�z�!�!�"�{��s�5�z�z�!�!�"�{��6r N)F)r r r r* )r( r) s ��r �DummyHashCalculatorr 9 s8 �� � � � � � � � � � � � � � r r+ z file3.txtTF� r r"