[diffoscope] 03/05: t/comparators: rename load_fixture() into init_fixture()

Mattia Rizzolo mattia at debian.org
Mon Jan 16 22:36:38 CET 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository diffoscope.

commit 9f9c60ab39ddc85d03cccff5e838d3c31903ff8d
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sun Jan 15 20:00:24 2017 +0100

    t/comparators: rename load_fixture() into init_fixture()
---
 tests/comparators/test_apk.py             |  6 +++---
 tests/comparators/test_binary.py          |  6 +++---
 tests/comparators/test_bzip2.py           |  6 +++---
 tests/comparators/test_cpio.py            |  6 +++---
 tests/comparators/test_deb.py             |  6 +++---
 tests/comparators/test_dex.py             |  6 +++---
 tests/comparators/test_elf.py             |  6 +++---
 tests/comparators/test_epub.py            |  6 +++---
 tests/comparators/test_fonts.py           |  6 +++---
 tests/comparators/test_fsimage.py         |  6 +++---
 tests/comparators/test_gettext.py         | 10 +++++-----
 tests/comparators/test_git.py             |  6 +++---
 tests/comparators/test_gzip.py            |  6 +++---
 tests/comparators/test_haskell.py         |  6 +++---
 tests/comparators/test_icc.py             |  6 +++---
 tests/comparators/test_ico_image.py       | 10 +++++-----
 tests/comparators/test_ipk.py             |  6 +++---
 tests/comparators/test_iso9660.py         |  6 +++---
 tests/comparators/test_java.py            |  6 +++---
 tests/comparators/test_javascript.py      |  6 +++---
 tests/comparators/test_jpeg_image.py      | 10 +++++-----
 tests/comparators/test_json.py            | 10 +++++-----
 tests/comparators/test_macho.py           |  6 +++---
 tests/comparators/test_mono.py            |  6 +++---
 tests/comparators/test_openssh_pub_key.py |  6 +++---
 tests/comparators/test_pdf.py             |  6 +++---
 tests/comparators/test_png.py             |  6 +++---
 tests/comparators/test_ppu.py             |  6 +++---
 tests/comparators/test_ps.py              |  6 +++---
 tests/comparators/test_rlib.py            |  6 +++---
 tests/comparators/test_rpm.py             |  6 +++---
 tests/comparators/test_sqlite.py          |  6 +++---
 tests/comparators/test_squashfs.py        |  6 +++---
 tests/comparators/test_tar.py             |  8 ++++----
 tests/comparators/test_text.py            | 16 ++++++++--------
 tests/comparators/test_utils.py           | 12 ++++++------
 tests/comparators/test_xz.py              |  6 +++---
 tests/comparators/test_zip.py             | 10 +++++-----
 tests/comparators/utils/data.py           |  2 +-
 39 files changed, 134 insertions(+), 134 deletions(-)

diff --git a/tests/comparators/test_apk.py b/tests/comparators/test_apk.py
index f57ef7e..52028c5 100644
--- a/tests/comparators/test_apk.py
+++ b/tests/comparators/test_apk.py
@@ -21,12 +21,12 @@ import pytest
 
 from diffoscope.comparators.apk import ApkFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
-apk1 = load_fixture(data('test1.apk'))
-apk2 = load_fixture(data('test2.apk'))
+apk1 = init_fixture(data('test1.apk'))
+apk2 = init_fixture(data('test2.apk'))
 
 def test_identification(apk1):
     assert isinstance(apk1, ApkFile)
diff --git a/tests/comparators/test_binary.py b/tests/comparators/test_binary.py
index 759c67d..2e64044 100644
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -32,7 +32,7 @@ from diffoscope.comparators.utils.file import File
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.utils.compare import Xxd
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
@@ -43,8 +43,8 @@ TEST_UNICODE_PATH = data('text_unicode1')
 TEST_ISO8859_PATH = data('text_iso8859')
 
 
-binary1 = load_fixture(TEST_FILE1_PATH)
-binary2 = load_fixture(TEST_FILE2_PATH)
+binary1 = init_fixture(TEST_FILE1_PATH)
+binary2 = init_fixture(TEST_FILE2_PATH)
 
 def normalize_zeros(s):
     # older xxd had one zero less.  Make sure there are always 8.
diff --git a/tests/comparators/test_bzip2.py b/tests/comparators/test_bzip2.py
index 9bf332e..9a209f9 100644
--- a/tests/comparators/test_bzip2.py
+++ b/tests/comparators/test_bzip2.py
@@ -24,7 +24,7 @@ from diffoscope.comparators.bzip2 import Bzip2File
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
@@ -32,8 +32,8 @@ from utils.nonexisting import assert_non_existing
 TEST_FILE1_PATH = data('test1.bz2')
 TEST_FILE2_PATH = data('test2.bz2')
 
-bzip1 = load_fixture(TEST_FILE1_PATH)
-bzip2 = load_fixture(TEST_FILE2_PATH)
+bzip1 = init_fixture(TEST_FILE1_PATH)
+bzip2 = init_fixture(TEST_FILE2_PATH)
 
 def test_identification(bzip1):
     assert isinstance(bzip1, Bzip2File)
diff --git a/tests/comparators/test_cpio.py b/tests/comparators/test_cpio.py
index a1eba51..c90950d 100644
--- a/tests/comparators/test_cpio.py
+++ b/tests/comparators/test_cpio.py
@@ -21,13 +21,13 @@ import pytest
 
 from diffoscope.comparators.cpio import CpioFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-cpio1 = load_fixture(data('test1.cpio'))
-cpio2 = load_fixture(data('test2.cpio'))
+cpio1 = init_fixture(data('test1.cpio'))
+cpio2 = init_fixture(data('test2.cpio'))
 
 def test_identification(cpio1):
     assert isinstance(cpio1, CpioFile)
diff --git a/tests/comparators/test_deb.py b/tests/comparators/test_deb.py
index 8684be2..64eb059 100644
--- a/tests/comparators/test_deb.py
+++ b/tests/comparators/test_deb.py
@@ -27,11 +27,11 @@ from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 
 
-deb1 = load_fixture(data('test1.deb'))
-deb2 = load_fixture(data('test2.deb'))
+deb1 = init_fixture(data('test1.deb'))
+deb2 = init_fixture(data('test2.deb'))
 
 def test_identification(deb1):
     assert isinstance(deb1, DebFile)
diff --git a/tests/comparators/test_dex.py b/tests/comparators/test_dex.py
index 647db5f..b241062 100644
--- a/tests/comparators/test_dex.py
+++ b/tests/comparators/test_dex.py
@@ -24,15 +24,15 @@ from diffoscope.config import Config
 from diffoscope.comparators.dex import DexFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from utils.nonexisting import assert_non_existing
 
 from test_java import javap_version
 
 
-dex1 = load_fixture(data('test1.dex'))
-dex2 = load_fixture(data('test2.dex'))
+dex1 = init_fixture(data('test1.dex'))
+dex2 = init_fixture(data('test2.dex'))
 
 def enjarify_version():
     # Module enjarify.typeinference appeared in enjarify 1.0.3.  We use a call
diff --git a/tests/comparators/test_elf.py b/tests/comparators/test_elf.py
index 1f10945..62dfe53 100644
--- a/tests/comparators/test_elf.py
+++ b/tests/comparators/test_elf.py
@@ -28,7 +28,7 @@ from diffoscope.comparators.directory import FilesystemDirectory
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
@@ -38,8 +38,8 @@ try:
 except ImportError:
     miss_debian_module = True
 
-obj1 = load_fixture(data('test1.o'))
-obj2 = load_fixture(data('test2.o'))
+obj1 = init_fixture(data('test1.o'))
+obj2 = init_fixture(data('test2.o'))
 
 def test_obj_identification(obj1):
     assert isinstance(obj1, ElfFile)
diff --git a/tests/comparators/test_epub.py b/tests/comparators/test_epub.py
index 17a3605..3a66b66 100644
--- a/tests/comparators/test_epub.py
+++ b/tests/comparators/test_epub.py
@@ -23,13 +23,13 @@ from diffoscope.config import Config
 from diffoscope.comparators.zip import ZipFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-epub1 = load_fixture(data('test1.epub'))
-epub2 = load_fixture(data('test2.epub'))
+epub1 = init_fixture(data('test1.epub'))
+epub2 = init_fixture(data('test2.epub'))
 
 def test_identification(epub1):
     assert isinstance(epub1, ZipFile)
diff --git a/tests/comparators/test_fonts.py b/tests/comparators/test_fonts.py
index 7ac58a1..177c107 100644
--- a/tests/comparators/test_fonts.py
+++ b/tests/comparators/test_fonts.py
@@ -23,12 +23,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.fonts import TtfFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-ttf1 = load_fixture(data('Samyak-Malayalam1.ttf'))
-ttf2 = load_fixture(data('Samyak-Malayalam2.ttf'))
+ttf1 = init_fixture(data('Samyak-Malayalam1.ttf'))
+ttf2 = init_fixture(data('Samyak-Malayalam2.ttf'))
 
 def test_identification(ttf1):
     assert isinstance(ttf1, TtfFile)
diff --git a/tests/comparators/test_fsimage.py b/tests/comparators/test_fsimage.py
index 2a5addd..ebae9df 100644
--- a/tests/comparators/test_fsimage.py
+++ b/tests/comparators/test_fsimage.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.fsimage import FsImageFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
@@ -33,8 +33,8 @@ try:
 except ImportError:
     miss_guestfs = True
 
-img1 = load_fixture(data('test1.ext4'))
-img2 = load_fixture(data('test2.ext4'))
+img1 = init_fixture(data('test1.ext4'))
+img2 = init_fixture(data('test2.ext4'))
 
 def guestfs_working():
     if miss_guestfs:
diff --git a/tests/comparators/test_gettext.py b/tests/comparators/test_gettext.py
index 3980e17..3d12d0a 100644
--- a/tests/comparators/test_gettext.py
+++ b/tests/comparators/test_gettext.py
@@ -24,12 +24,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.gettext import MoFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-mo1 = load_fixture(data('test1.mo'))
-mo2 = load_fixture(data('test2.mo'))
+mo1 = init_fixture(data('test1.mo'))
+mo2 = init_fixture(data('test2.mo'))
 
 def test_identification(mo1):
     assert isinstance(mo1, MoFile)
@@ -47,8 +47,8 @@ def test_diff(differences):
     expected_diff = open(data('mo_expected_diff')).read()
     assert differences[0].unified_diff == expected_diff
 
-mo_no_charset = load_fixture(data('test_no_charset.mo'))
-mo_iso8859_1 = load_fixture(data('test_iso8859-1.mo'))
+mo_no_charset = init_fixture(data('test_no_charset.mo'))
+mo_iso8859_1 = init_fixture(data('test_iso8859-1.mo'))
 
 @skip_unless_tools_exist('msgunfmt')
 def test_charsets(mo_no_charset, mo_iso8859_1):
diff --git a/tests/comparators/test_git.py b/tests/comparators/test_git.py
index e180872..074f1a0 100644
--- a/tests/comparators/test_git.py
+++ b/tests/comparators/test_git.py
@@ -21,11 +21,11 @@ import pytest
 
 from diffoscope.comparators.git import GitIndexFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 
 
-git1 = load_fixture(data('test1.git-index'))
-git2 = load_fixture(data('test2.git-index'))
+git1 = init_fixture(data('test1.git-index'))
+git2 = init_fixture(data('test2.git-index'))
 
 def test_identification(git1):
     assert isinstance(git1, GitIndexFile)
diff --git a/tests/comparators/test_gzip.py b/tests/comparators/test_gzip.py
index 97a7a21..52fb24e 100644
--- a/tests/comparators/test_gzip.py
+++ b/tests/comparators/test_gzip.py
@@ -26,15 +26,15 @@ from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 
 
 TEST_FILE1_PATH = data('test1.gz')
 TEST_FILE2_PATH = data('test2.gz')
 
 
-gzip1 = load_fixture(TEST_FILE1_PATH)
-gzip2 = load_fixture(TEST_FILE2_PATH)
+gzip1 = init_fixture(TEST_FILE1_PATH)
+gzip2 = init_fixture(TEST_FILE2_PATH)
 
 def test_identification(gzip1):
     assert isinstance(gzip1, GzipFile)
diff --git a/tests/comparators/test_haskell.py b/tests/comparators/test_haskell.py
index b962bda..f323a02 100644
--- a/tests/comparators/test_haskell.py
+++ b/tests/comparators/test_haskell.py
@@ -22,12 +22,12 @@ import pytest
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.haskell import HiFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-haskell1 = load_fixture(data('test1.hi'))
-haskell2 = load_fixture(data('test2.hi'))
+haskell1 = init_fixture(data('test1.hi'))
+haskell2 = init_fixture(data('test2.hi'))
 
 @skip_unless_tools_exist('ghc')
 def test_identification(haskell1):
diff --git a/tests/comparators/test_icc.py b/tests/comparators/test_icc.py
index db301bc..adf9e4b 100644
--- a/tests/comparators/test_icc.py
+++ b/tests/comparators/test_icc.py
@@ -23,12 +23,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.icc import IccFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-icc1 = load_fixture(data('test1.icc'))
-icc2 = load_fixture(data('test2.icc'))
+icc1 = init_fixture(data('test1.icc'))
+icc2 = init_fixture(data('test2.icc'))
 
 def test_identification(icc1):
     assert isinstance(icc1, IccFile)
diff --git a/tests/comparators/test_ico_image.py b/tests/comparators/test_ico_image.py
index 1bd706b..1c03751 100644
--- a/tests/comparators/test_ico_image.py
+++ b/tests/comparators/test_ico_image.py
@@ -22,15 +22,15 @@ import pytest
 from diffoscope.config import Config
 from diffoscope.comparators.image import ICOImageFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from test_jpeg_image import identify_version
 
 
-image1 = load_fixture(data('test1.ico'))
-image2 = load_fixture(data('test2.ico'))
-image1_meta = load_fixture(data('test1_meta.ico'))
-image2_meta = load_fixture(data('test2_meta.ico'))
+image1 = init_fixture(data('test1.ico'))
+image2 = init_fixture(data('test2.ico'))
+image1_meta = init_fixture(data('test1_meta.ico'))
+image2_meta = init_fixture(data('test2_meta.ico'))
 
 def test_identification(image1):
     assert isinstance(image1, ICOImageFile)
diff --git a/tests/comparators/test_ipk.py b/tests/comparators/test_ipk.py
index 529cbfa..c1e4235 100644
--- a/tests/comparators/test_ipk.py
+++ b/tests/comparators/test_ipk.py
@@ -23,11 +23,11 @@ from diffoscope.config import Config
 from diffoscope.comparators.ipk import IpkFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 
 
-ipk1 = load_fixture(data('base-files_157-r45695_ar71xx.ipk'))
-ipk2 = load_fixture(data('base-files_157-r45918_ar71xx.ipk'))
+ipk1 = init_fixture(data('base-files_157-r45695_ar71xx.ipk'))
+ipk2 = init_fixture(data('base-files_157-r45918_ar71xx.ipk'))
 
 def test_identification(ipk1):
     assert isinstance(ipk1, IpkFile)
diff --git a/tests/comparators/test_iso9660.py b/tests/comparators/test_iso9660.py
index 4deb805..c3999f7 100644
--- a/tests/comparators/test_iso9660.py
+++ b/tests/comparators/test_iso9660.py
@@ -23,12 +23,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.iso9660 import Iso9660File
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-iso1 = load_fixture(data('test1.iso'))
-iso2 = load_fixture(data('test2.iso'))
+iso1 = init_fixture(data('test1.iso'))
+iso2 = init_fixture(data('test2.iso'))
 
 def test_identification(iso1):
     assert isinstance(iso1, Iso9660File)
diff --git a/tests/comparators/test_java.py b/tests/comparators/test_java.py
index 975c593..9152991 100644
--- a/tests/comparators/test_java.py
+++ b/tests/comparators/test_java.py
@@ -24,12 +24,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.java import ClassFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 
 
-class1 = load_fixture(data('Test1.class'))
-class2 = load_fixture(data('Test2.class'))
+class1 = init_fixture(data('Test1.class'))
+class2 = init_fixture(data('Test2.class'))
 
 def javap_version():
     try:
diff --git a/tests/comparators/test_javascript.py b/tests/comparators/test_javascript.py
index 1d26e43..db32026 100644
--- a/tests/comparators/test_javascript.py
+++ b/tests/comparators/test_javascript.py
@@ -23,12 +23,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.javascript import JavaScriptFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-javascript1 = load_fixture(data('test1.js'))
-javascript2 = load_fixture(data('test2.js'))
+javascript1 = init_fixture(data('test1.js'))
+javascript2 = init_fixture(data('test2.js'))
 
 def test_identification(javascript1):
     assert isinstance(javascript1, JavaScriptFile)
diff --git a/tests/comparators/test_jpeg_image.py b/tests/comparators/test_jpeg_image.py
index fb455eb..784ef31 100644
--- a/tests/comparators/test_jpeg_image.py
+++ b/tests/comparators/test_jpeg_image.py
@@ -24,14 +24,14 @@ from diffoscope.config import Config
 from diffoscope.comparators.image import JPEGImageFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 
 
-image1 = load_fixture(data('test1.jpg'))
-image2 = load_fixture(data('test2.jpg'))
-image1_meta = load_fixture(data('test1_meta.jpg'))
-image2_meta = load_fixture(data('test2_meta.jpg'))
+image1 = init_fixture(data('test1.jpg'))
+image2 = init_fixture(data('test2.jpg'))
+image1_meta = init_fixture(data('test1_meta.jpg'))
+image2_meta = init_fixture(data('test2_meta.jpg'))
 
 def identify_version():
     out = subprocess.check_output(['identify', '-version'])
diff --git a/tests/comparators/test_json.py b/tests/comparators/test_json.py
index 339128b..150d5a4 100644
--- a/tests/comparators/test_json.py
+++ b/tests/comparators/test_json.py
@@ -21,14 +21,14 @@ import pytest
 
 from diffoscope.comparators.json import JSONFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.nonexisting import assert_non_existing
 
 
-json1 = load_fixture(data('test1.json'))
-json2 = load_fixture(data('test2.json'))
-json3a = load_fixture(data('order1a.json'))
-json3b = load_fixture(data('order1b.json'))
+json1 = init_fixture(data('test1.json'))
+json2 = init_fixture(data('test2.json'))
+json3a = init_fixture(data('order1a.json'))
+json3b = init_fixture(data('order1b.json'))
 
 def test_identification(json1):
     assert isinstance(json1, JSONFile)
diff --git a/tests/comparators/test_macho.py b/tests/comparators/test_macho.py
index ae3d0d1..3d12764 100644
--- a/tests/comparators/test_macho.py
+++ b/tests/comparators/test_macho.py
@@ -25,12 +25,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.macho import MachoFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
-obj1 = load_fixture(data('test1.macho'))
-obj2 = load_fixture(data('test2.macho'))
+obj1 = init_fixture(data('test1.macho'))
+obj2 = init_fixture(data('test2.macho'))
 
 def test_obj_identification(obj1):
     assert isinstance(obj1, MachoFile)
diff --git a/tests/comparators/test_mono.py b/tests/comparators/test_mono.py
index 96ced6e..8744160 100644
--- a/tests/comparators/test_mono.py
+++ b/tests/comparators/test_mono.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
 from diffoscope.comparators.mono import MonoExeFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 
 
@@ -32,8 +32,8 @@ from utils.tools import skip_unless_tools_exist
 # echo 'public class Test { static public void Main () {} }' > test.cs
 # mcs -out:test1.exe test.cs ; sleep 2; mcs -out:test2.exe test.cs
 
-exe1 = load_fixture(data('test1.exe'))
-exe2 = load_fixture(data('test2.exe'))
+exe1 = init_fixture(data('test1.exe'))
+exe2 = init_fixture(data('test2.exe'))
 
 def test_identification(exe1):
     assert isinstance(exe1, MonoExeFile)
diff --git a/tests/comparators/test_openssh_pub_key.py b/tests/comparators/test_openssh_pub_key.py
index e63d4e2..236c5d7 100644
--- a/tests/comparators/test_openssh_pub_key.py
+++ b/tests/comparators/test_openssh_pub_key.py
@@ -24,14 +24,14 @@ from diffoscope.config import Config
 from diffoscope.comparators.openssh import PublicKeyFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 
 
 # Generated by: ssh-keygen -t dsa -C "Test1"
-opensshpubkey1 = load_fixture(data('test_openssh_pub_key1.pub'))
+opensshpubkey1 = init_fixture(data('test_openssh_pub_key1.pub'))
 # Generated by: ssh-keygen -t rsa -b 4096 -C "Test2"
-opensshpubkey2 = load_fixture(data('test_openssh_pub_key2.pub'))
+opensshpubkey2 = init_fixture(data('test_openssh_pub_key2.pub'))
 
 
 def openssh_version():
diff --git a/tests/comparators/test_pdf.py b/tests/comparators/test_pdf.py
index 6b166b3..fd121a2 100644
--- a/tests/comparators/test_pdf.py
+++ b/tests/comparators/test_pdf.py
@@ -21,13 +21,13 @@ import pytest
 
 from diffoscope.comparators.pdf import PdfFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-pdf1 = load_fixture(data('test1.pdf'))
-pdf2 = load_fixture(data('test2.pdf'))
+pdf1 = init_fixture(data('test1.pdf'))
+pdf2 = init_fixture(data('test2.pdf'))
 
 def test_identification(pdf1):
     assert isinstance(pdf1, PdfFile)
diff --git a/tests/comparators/test_png.py b/tests/comparators/test_png.py
index 8541911..26b1b62 100644
--- a/tests/comparators/test_png.py
+++ b/tests/comparators/test_png.py
@@ -21,13 +21,13 @@ import pytest
 
 from diffoscope.comparators.png import PngFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-png1 = load_fixture(data('test1.png'))
-png2 = load_fixture(data('test2.png'))
+png1 = init_fixture(data('test1.png'))
+png2 = init_fixture(data('test2.png'))
 
 def test_identification(png1):
     assert isinstance(png1, PngFile)
diff --git a/tests/comparators/test_ppu.py b/tests/comparators/test_ppu.py
index 5b7c3b9..c9e0d91 100644
--- a/tests/comparators/test_ppu.py
+++ b/tests/comparators/test_ppu.py
@@ -23,7 +23,7 @@ import subprocess
 
 from diffoscope.comparators.ppu import PpuFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from utils.nonexisting import assert_non_existing
 
@@ -34,8 +34,8 @@ from utils.nonexisting import assert_non_existing
 # castletexturefont_dejavusans_10.ppu which are generated during package
 # building of the cge package from dejavusans font in the fonts-dejavu package.
 
-file1 = load_fixture(data('test1.ppu'))
-file2 = load_fixture(data('test2.ppu'))
+file1 = init_fixture(data('test1.ppu'))
+file2 = init_fixture(data('test2.ppu'))
 
 def ppudump_version():
     # first line of `PPU-Analyser Version 3.0.0` looks like:
diff --git a/tests/comparators/test_ps.py b/tests/comparators/test_ps.py
index 71cd8eb..e03f829 100644
--- a/tests/comparators/test_ps.py
+++ b/tests/comparators/test_ps.py
@@ -21,13 +21,13 @@ import pytest
 
 from diffoscope.comparators.ps import PsFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-ps1 = load_fixture(data('test1.ps'))
-ps2 = load_fixture(data('test2.ps'))
+ps1 = init_fixture(data('test1.ps'))
+ps2 = init_fixture(data('test2.ps'))
 
 def test_identification(ps1):
     assert isinstance(ps1, PsFile)
diff --git a/tests/comparators/test_rlib.py b/tests/comparators/test_rlib.py
index 1dd7897..6ae7d07 100644
--- a/tests/comparators/test_rlib.py
+++ b/tests/comparators/test_rlib.py
@@ -24,14 +24,14 @@ import subprocess
 from diffoscope.comparators.ar import ArFile
 
 from utils import diff_ignore_line_numbers
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from utils.nonexisting import assert_non_existing
 
 
 
-rlib1 = load_fixture(data('test1.rlib'))
-rlib2 = load_fixture(data('test2.rlib'))
+rlib1 = init_fixture(data('test1.rlib'))
+rlib2 = init_fixture(data('test2.rlib'))
 
 def llvm_version():
     return subprocess.check_output(['llvm-config', '--version']).decode("utf-8").strip()
diff --git a/tests/comparators/test_rpm.py b/tests/comparators/test_rpm.py
index d65770d..62da4fe 100644
--- a/tests/comparators/test_rpm.py
+++ b/tests/comparators/test_rpm.py
@@ -19,7 +19,7 @@
 
 import pytest
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
@@ -31,8 +31,8 @@ except ImportError:
     from diffoscope.comparators.rpm_fallback import RpmFile
     miss_rpm_module = True
 
-rpm1 = load_fixture(data('test1.rpm'))
-rpm2 = load_fixture(data('test2.rpm'))
+rpm1 = init_fixture(data('test1.rpm'))
+rpm2 = init_fixture(data('test2.rpm'))
 
 def test_identification(rpm1):
     assert isinstance(rpm1, RpmFile)
diff --git a/tests/comparators/test_sqlite.py b/tests/comparators/test_sqlite.py
index 3fff569..dd754bd 100644
--- a/tests/comparators/test_sqlite.py
+++ b/tests/comparators/test_sqlite.py
@@ -21,13 +21,13 @@ import pytest
 
 from diffoscope.comparators.sqlite import Sqlite3Database
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-sqlite3db1 = load_fixture(data('test1.sqlite3'))
-sqlite3db2 = load_fixture(data('test2.sqlite3'))
+sqlite3db1 = init_fixture(data('test1.sqlite3'))
+sqlite3db2 = init_fixture(data('test2.sqlite3'))
 
 def test_identification(sqlite3db1):
     assert isinstance(sqlite3db1, Sqlite3Database)
diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index 00b2839..8d93c52 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -22,7 +22,7 @@ import subprocess
 
 from diffoscope.comparators.squashfs import SquashfsFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from utils.nonexisting import assert_non_existing
 
@@ -36,8 +36,8 @@ def unsquashfs_version():
         out = e.output
     return out.decode('UTF-8').splitlines()[0].split()[2].strip()
 
-squashfs1 = load_fixture(data('test1.squashfs'))
-squashfs2 = load_fixture(data('test2.squashfs'))
+squashfs1 = init_fixture(data('test1.squashfs'))
+squashfs2 = init_fixture(data('test2.squashfs'))
 
 def test_identification(squashfs1):
     assert isinstance(squashfs1, SquashfsFile)
diff --git a/tests/comparators/test_tar.py b/tests/comparators/test_tar.py
index 3ddfb58..88d0aa9 100644
--- a/tests/comparators/test_tar.py
+++ b/tests/comparators/test_tar.py
@@ -23,12 +23,12 @@ from diffoscope.config import Config
 from diffoscope.comparators.tar import TarFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.nonexisting import assert_non_existing
 
 
-tar1 = load_fixture(data('test1.tar'))
-tar2 = load_fixture(data('test2.tar'))
+tar1 = init_fixture(data('test1.tar'))
+tar2 = init_fixture(data('test2.tar'))
 
 def test_identification(tar1):
     assert isinstance(tar1, TarFile)
@@ -61,7 +61,7 @@ def test_text_file(differences):
 def test_compare_non_existing(monkeypatch, tar1):
     assert_non_existing(monkeypatch, tar1)
 
-no_permissions_tar = load_fixture(data('no-perms.tar'))
+no_permissions_tar = init_fixture(data('no-perms.tar'))
 
 # Reported as Debian #797164. This is a good way to notice if we unpack directories
 # as we won't be able to remove files in one if we don't have write permissions.
diff --git a/tests/comparators/test_text.py b/tests/comparators/test_text.py
index 45babfc..4308022 100644
--- a/tests/comparators/test_text.py
+++ b/tests/comparators/test_text.py
@@ -22,12 +22,12 @@ import codecs
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.nonexisting import assert_non_existing
 
 
-ascii1 = load_fixture(data('text_ascii1'))
-ascii2 = load_fixture(data('text_ascii2'))
+ascii1 = init_fixture(data('text_ascii1'))
+ascii2 = init_fixture(data('text_ascii2'))
 
 def test_no_differences(ascii1):
     difference = ascii1.compare(ascii1)
@@ -41,15 +41,15 @@ def test_difference_in_ascii(ascii1, ascii2):
     assert not difference.comments
     assert len(difference.details) == 0
 
-unicode1 = load_fixture(data('text_unicode1'))
-unicode2 = load_fixture(data('text_unicode2'))
+unicode1 = init_fixture(data('text_unicode1'))
+unicode2 = init_fixture(data('text_unicode2'))
 
 def test_difference_in_unicode(unicode1, unicode2):
     difference = unicode1.compare(unicode2)
     expected_diff = codecs.open(data('text_unicode_expected_diff'), encoding='utf-8').read()
     assert difference.unified_diff == expected_diff
 
-iso8859 = load_fixture(data('text_iso8859'))
+iso8859 = init_fixture(data('text_iso8859'))
 
 def test_difference_between_iso88591_and_unicode(iso8859, unicode1):
     difference = iso8859.compare(unicode1)
@@ -68,8 +68,8 @@ def test_difference_between_iso88591_and_unicode_only(iso8859, tmpdir):
 def test_compare_non_existing(monkeypatch, ascii1):
     assert_non_existing(monkeypatch, ascii1, has_null_source=False, has_details=False)
 
-text_order1 = load_fixture(data('text_order1'))
-text_order2 = load_fixture(data('text_order2'))
+text_order1 = init_fixture(data('text_order1'))
+text_order2 = init_fixture(data('text_order2'))
 
 def test_ordering_differences(text_order1, text_order2):
     difference = text_order1.compare(text_order2)
diff --git a/tests/comparators/test_utils.py b/tests/comparators/test_utils.py
index 02d2c94..0f864c0 100644
--- a/tests/comparators/test_utils.py
+++ b/tests/comparators/test_utils.py
@@ -24,7 +24,7 @@ from diffoscope.config import Config
 from diffoscope.difference import Difference
 from diffoscope.comparators.utils.command import Command
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import tools_missing, skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
@@ -35,9 +35,9 @@ try:
 except ImportError:
     miss_tlsh = True
 
-fuzzy_tar1 = load_fixture(data('fuzzy1.tar'))
-fuzzy_tar2 = load_fixture(data('fuzzy2.tar'))
-fuzzy_tar3 = load_fixture(data('fuzzy3.tar'))
+fuzzy_tar1 = init_fixture(data('fuzzy1.tar'))
+fuzzy_tar2 = init_fixture(data('fuzzy2.tar'))
+fuzzy_tar3 = init_fixture(data('fuzzy3.tar'))
 
 def test_tools_missing():
     assert tools_missing() is True
@@ -78,8 +78,8 @@ def test_fuzzy_matching_only_once(fuzzy_tar1, fuzzy_tar3):
     assert len(differences) == 2
     expected_diff = codecs.open(data('text_iso8859_expected_diff'), encoding='utf-8').read()
 
-fuzzy_tar_in_tar1 = load_fixture(data('fuzzy-tar-in-tar1.tar'))
-fuzzy_tar_in_tar2 = load_fixture(data('fuzzy-tar-in-tar2.tar'))
+fuzzy_tar_in_tar1 = init_fixture(data('fuzzy-tar-in-tar1.tar'))
+fuzzy_tar_in_tar2 = init_fixture(data('fuzzy-tar-in-tar2.tar'))
 
 @pytest.mark.skipif(miss_tlsh, reason='tlsh is missing')
 def test_no_fuzzy_matching(monkeypatch, fuzzy_tar_in_tar1, fuzzy_tar_in_tar2):
diff --git a/tests/comparators/test_xz.py b/tests/comparators/test_xz.py
index 844fb1d..ead03db 100644
--- a/tests/comparators/test_xz.py
+++ b/tests/comparators/test_xz.py
@@ -24,7 +24,7 @@ from diffoscope.comparators.xz import XzFile
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
@@ -32,8 +32,8 @@ from utils.nonexisting import assert_non_existing
 TEST_FILE1_PATH = data('test1.xz')
 TEST_FILE2_PATH = data('test2.xz')
 
-xz1 = load_fixture(TEST_FILE1_PATH)
-xz2 = load_fixture(TEST_FILE2_PATH)
+xz1 = init_fixture(TEST_FILE1_PATH)
+xz2 = init_fixture(TEST_FILE2_PATH)
 
 def test_identification(xz1):
     assert isinstance(xz1, XzFile)
diff --git a/tests/comparators/test_zip.py b/tests/comparators/test_zip.py
index 125e494..7491708 100644
--- a/tests/comparators/test_zip.py
+++ b/tests/comparators/test_zip.py
@@ -21,13 +21,13 @@ import pytest
 
 from diffoscope.comparators.zip import ZipFile, MozillaZipFile
 
-from utils.data import data, load_fixture
+from utils.data import data, init_fixture
 from utils.tools import skip_unless_tools_exist
 from utils.nonexisting import assert_non_existing
 
 
-zip1 = load_fixture(data('test1.zip'))
-zip2 = load_fixture(data('test2.zip'))
+zip1 = init_fixture(data('test1.zip'))
+zip2 = init_fixture(data('test2.zip'))
 
 def test_identification(zip1):
     assert isinstance(zip1, ZipFile)
@@ -59,8 +59,8 @@ def test_compare_non_existing(monkeypatch, zip1):
 TEST_MOZZIP1_PATH = data('test1.mozzip')
 TEST_MOZZIP2_PATH = data('test2.mozzip')
 
-mozzip1 = load_fixture(TEST_MOZZIP1_PATH)
-mozzip2 = load_fixture(TEST_MOZZIP2_PATH)
+mozzip1 = init_fixture(TEST_MOZZIP1_PATH)
+mozzip2 = init_fixture(TEST_MOZZIP2_PATH)
 
 def test_mozzip_identification(mozzip1):
     assert isinstance(mozzip1, MozillaZipFile)
diff --git a/tests/comparators/utils/data.py b/tests/comparators/utils/data.py
index 5a8df13..f73e356 100644
--- a/tests/comparators/utils/data.py
+++ b/tests/comparators/utils/data.py
@@ -25,7 +25,7 @@ from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
 
-def load_fixture(filename):
+def init_fixture(filename):
     return pytest.fixture(
         lambda: specialize(FilesystemFile(filename))
     )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list