1#
2# diffoscope: in-depth comparison of files, archives, and directories
3#
4# Copyright © 2017, 2020 Chris Lamb <lamby@debian.org>
5#
6# diffoscope is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# diffoscope is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
18
19import pytest
20
21from diffoscope.comparators.fontconfig import FontconfigCacheFile
22
23from ..utils.data import load_fixture, assert_diff
24
25cache1 = load_fixture("test1-le64.cache-4")
26cache2 = load_fixture("test2-le64.cache-4")
27
28
29def test_identification(cache1):
30    assert isinstance(cache1, FontconfigCacheFile)
31
32
33def test_no_differences(cache1):
34    difference = cache1.compare(cache1)
35    assert difference is None
36
37
38@pytest.fixture
39def differences(cache1, cache2):
40    return cache1.compare(cache2).details
41
42
43def test_diff(differences):
44    assert_diff(differences[0], "fontconfig_expected_diff")
45