[diffoscope] 01/01: Remove test data causing problems during build with Python 3.4
Mattia Rizzolo
mattia at debian.org
Sun Dec 11 00:18:29 CET 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository diffoscope.
commit 76b5c2b0daa13d6614ab9f591801299807bc50f5
Author: Maria Glukhova <siamezzze at gmail.com>
Date: Sat Dec 10 22:57:16 2016 +0200
Remove test data causing problems during build with Python 3.4
Test data containing symlinks to directories caused problems during build in
jessie-backports while pytest copies it.
Remove that data and rewrite the test to use temporary files instead.
Closes #842834
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
tests/comparators/test_binary.py | 24 +++++++++++++++++++-----
tests/data/dir_and_symlink_a/dir/.gitignore | 0
tests/data/dir_and_symlink_a/lnk | 1 -
tests/data/dir_and_symlink_b/dir/.gitignore | 0
tests/data/dir_and_symlink_b/lnk | 1 -
5 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/tests/comparators/test_binary.py b/tests/comparators/test_binary.py
index 79ee1fb..4bec1ba 100644
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -28,14 +28,15 @@ from diffoscope.difference import Difference
from diffoscope.comparators.binary import File, FilesystemFile, NonExistingFile
from utils import skip_unless_tools_exist, data, load_fixture
+from os import mkdir, symlink
+from tempfile import TemporaryDirectory
+import os.path
TEST_FILE1_PATH = data('binary1')
TEST_FILE2_PATH = data('binary2')
TEST_ASCII_PATH = data('text_ascii1')
TEST_UNICODE_PATH = data('text_unicode1')
TEST_ISO8859_PATH = data('text_iso8859')
-TEST_SYMLINK2DIR1_PATH = data('dir_and_symlink_a')
-TEST_SYMLINK2DIR2_PATH = data('dir_and_symlink_b')
binary1 = load_fixture(TEST_FILE1_PATH)
@@ -153,6 +154,19 @@ def test_compare_two_nonexisting_files():
assert 'non-existing' in difference.comment
def test_symlink_to_dir():
- file1 = FilesystemFile(TEST_SYMLINK2DIR1_PATH)
- file2 = FilesystemFile(TEST_SYMLINK2DIR2_PATH)
- assert file1.has_same_content_as(file2) is False
+ # Create 2 directories, each containing sub-directory src and symbolic link dst-->src.
+ with TemporaryDirectory() as basepath1:
+ with TemporaryDirectory() as basepath2:
+ src1path = os.path.join(basepath1, 'src')
+ dst1path = os.path.join(basepath1, 'lnk')
+ src2path = os.path.join(basepath2, 'src')
+ dst2path = os.path.join(basepath2, 'lnk')
+ mkdir(src1path)
+ mkdir(src2path)
+ symlink(src1path, dst1path)
+ symlink(src2path, dst2path)
+
+ # Compare these directories' content.
+ file1 = FilesystemFile(basepath1)
+ file2 = FilesystemFile(basepath2)
+ assert file1.has_same_content_as(file2) is False
diff --git a/tests/data/dir_and_symlink_a/dir/.gitignore b/tests/data/dir_and_symlink_a/dir/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/data/dir_and_symlink_a/lnk b/tests/data/dir_and_symlink_a/lnk
deleted file mode 120000
index 8724519..0000000
--- a/tests/data/dir_and_symlink_a/lnk
+++ /dev/null
@@ -1 +0,0 @@
-dir
\ No newline at end of file
diff --git a/tests/data/dir_and_symlink_b/dir/.gitignore b/tests/data/dir_and_symlink_b/dir/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/data/dir_and_symlink_b/lnk b/tests/data/dir_and_symlink_b/lnk
deleted file mode 120000
index 8724519..0000000
--- a/tests/data/dir_and_symlink_b/lnk
+++ /dev/null
@@ -1 +0,0 @@
-dir
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list