[Git][reproducible-builds/diffoscope][master] Revert "Drop two more test fixture fires for the directory tests." - need to...
Chris Lamb
gitlab at salsa.debian.org
Sat Nov 23 17:12:23 UTC 2019
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
83ad6def by Chris Lamb at 2019-11-23T17:12:08Z
Revert "Drop two more test fixture fires for the directory tests." - need to fix some other tests too.
This reverts commit a0f7a11b6e5adbe8e5e0a99cee3e7accb7a1afbf.
- - - - -
4 changed files:
- tests/comparators/test_directory.py
- + tests/data/text_ascii1
- + tests/data/text_ascii2
- tests/test_source.py
Changes:
=====================================
tests/comparators/test_directory.py
=====================================
@@ -26,28 +26,11 @@ from diffoscope.comparators.binary import FilesystemFile
from diffoscope.comparators.directory import compare_directories
from diffoscope.comparators.utils.specialize import specialize
-from ..utils.data import get_data
+from ..utils.data import data, get_data
-ASCII1 = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
-incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
-nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
-fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
-culpa qui officia deserunt mollit anim id est laborum.
-"""
-ASCII2 = """A common form of lorem ipsum reads:
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
-incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
-nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
-fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
-culpa qui officia deserunt mollit anim id est laborum.
-
-"Lorem ipsum" text is derived from sections 1.10.32--3 of Cicero's De finibus
-bonorum et malorum (On the Ends of Goods and Evils, or alternatively [About]
-The Purposes of Good and Evil)."""
+TEST_FILE1_PATH = data('text_ascii1')
+TEST_FILE2_PATH = data('text_ascii2')
def test_no_differences():
@@ -70,10 +53,8 @@ def differences(tmpdir):
tmpdir.mkdir('a/dir')
tmpdir.mkdir('b')
tmpdir.mkdir('b/dir')
- with open(str(tmpdir.join('a/dir/text')), 'w') as f:
- f.write(ASCII1)
- with open(str(tmpdir.join('b/dir/text')), 'w') as f:
- f.write(ASCII2)
+ shutil.copy(TEST_FILE1_PATH, str(tmpdir.join('a/dir/text')))
+ shutil.copy(TEST_FILE2_PATH, str(tmpdir.join('b/dir/text')))
os.utime(str(tmpdir.join('a/dir/text')), (0, 0))
os.utime(str(tmpdir.join('b/dir/text')), (0, 0))
os.utime(str(tmpdir.join('a/dir')), (0, 0))
=====================================
tests/data/text_ascii1
=====================================
@@ -0,0 +1,6 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
=====================================
tests/data/text_ascii2
=====================================
@@ -0,0 +1,12 @@
+A common form of lorem ipsum reads:
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+
+"Lorem ipsum" text is derived from sections 1.10.32--3 of Cicero's De finibus
+bonorum et malorum (On the Ends of Goods and Evils, or alternatively [About]
+The Purposes of Good and Evil).
=====================================
tests/test_source.py
=====================================
@@ -218,6 +218,8 @@ ALLOWED_TEST_FILES = {
'test_openssh_pub_key2.pub',
'test_weird_non_unicode_chars1.pdf',
'test_weird_non_unicode_chars2.pdf',
+ 'text_ascii1',
+ 'text_ascii2',
'text_iso8859',
'text_order1',
'text_order2',
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/83ad6def51600fea545356c87d387f587ef17e53
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/83ad6def51600fea545356c87d387f587ef17e53
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20191123/0d24785a/attachment.htm>
More information about the rb-commits
mailing list