OwlCyberSecurity - MANAGER
Edit File: test_compare_images.cpython-38.pyc
U ��]S � @ st d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ edd� �\ZZ ej �ddd d ddd dg�dd� �ZdS )� N)�approx)�compare_images)�_image_directoriesc C s dS )Nz dummy func� r r r �F/usr/lib/python3/dist-packages/matplotlib/tests/test_compare_images.py�<lambda> � r zim1, im2, tol, expect_rms)�basn3p02.png�basn3p02-minorchange.png� N)r r r g��Bs�@)r zbasn3p02-1px-offset.pngr g%̴��V@)r zbasn3p02-half-1px-offset.pngr g �O@)r zbasn3p02-scrambled.pngr g�D/�X�e@)� all127.png� all128.pngr � )r r r r c C s� t j�t| �} t j�t|�}t j�t|�}t�||� t| ||dd�}|dkr\|dks�t�n$|dk sht�|d t |dd�ks�t�dS )a� Compare two images, expecting a particular RMS error. im1 and im2 are filenames relative to the baseline_dir directory. tol is the tolerance to pass to compare_images. expect_rms is the expected RMS value, or None. If None, the test will succeed if compare_images succeeds. Otherwise, the test will succeed if compare_images fails and returns an RMS error almost equal to this value. T)�tolZin_decoratorNZrmsg-C��6?)�abs) �os�path�join�baseline_dir� result_dir�shutilZcopyfiler �AssertionErrorr )Zim1Zim2r Z expect_rmsZim2_srcZresultsr r r � test_image_comparison_expect_rms s ,r ) r r Zpytestr Zmatplotlib.testing.comparer Zmatplotlib.testing.decoratorsr r r ZmarkZparametrizer r r r r �<module> s$ ��!