[diffoscope] 09/09: Change the tests for containers to use existing test files.

Maria Glukhova siamezzze-guest at moszumanska.debian.org
Mon Feb 13 20:39:59 CET 2017


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

siamezzze-guest pushed a commit to branch siamezzze/containers
in repository diffoscope.

commit 9570f1cf1a01d3cec86f2313fb3e1e7eac57a9eb
Author: Maria Glukhova <siamezzze at gmail.com>
Date:   Mon Feb 13 15:33:31 2017 +0200

    Change the tests for containers to use existing test files.
---
 tests/comparators/test_containers.py         |  10 +++++-----
 tests/data/containers_content_expected_diff  |   3 ---
 tests/data/containers_filelist_expected_diff |  16 ++++++++--------
 tests/data/test3.cpio                        | Bin 512 -> 0 bytes
 tests/data/test3.tar                         | Bin 10240 -> 0 bytes
 5 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/tests/comparators/test_containers.py b/tests/comparators/test_containers.py
index fbc8c67..e4278c7 100644
--- a/tests/comparators/test_containers.py
+++ b/tests/comparators/test_containers.py
@@ -27,8 +27,8 @@ from utils.tools import skip_unless_tools_exist
 test_tar_gz = load_fixture('test1.tar.gz')
 test_zip_bz2 = load_fixture('test2.zip.bz2')
 test_zip = load_fixture('test2.zip')
-test_tar = load_fixture('test3.tar')
-test_cpio = load_fixture('test3.cpio')
+test_tar = load_fixture('test1.tar')
+test_cpio = load_fixture('test2.cpio')
 
 @pytest.fixture
 def differences_containers(test_tar, test_cpio):
@@ -44,21 +44,21 @@ def differences_different_levels(test_tar_gz, test_zip):
 
 @skip_unless_tools_exist('cpio')
 def test_file_list(differences_containers):
-    expected_diff = open(data('containers_filelist_expected_diff')).read()
+    expected_diff = get_data('containers_filelist_expected_diff')
     assert differences_containers[1].source1 == 'file list'
     assert differences_containers[1].source2 == 'file list'
     assert differences_containers[1].unified_diff == expected_diff
 
 @skip_unless_tools_exist('cpio')
 def test_types(differences_containers):
-    expected_diff = open(data('containers_types_expected_diff')).read()
+    expected_diff = get_data('containers_types_expected_diff')
     assert differences_containers[0].source1 == 'container type'
     assert differences_containers[0].source2 == 'container type'
     assert differences_containers[0].unified_diff == expected_diff
 
 @skip_unless_tools_exist('cpio')
 def test_content(differences_containers):
-    expected_diff = open(data('containers_content_expected_diff')).read()
+    expected_diff = get_data('text_ascii_expected_diff')
     assert differences_containers[2].unified_diff == expected_diff
 
 @skip_unless_tools_exist('bzip2', 'gzip', 'zipinfo')
diff --git a/tests/data/containers_content_expected_diff b/tests/data/containers_content_expected_diff
deleted file mode 100644
index 049140e..0000000
--- a/tests/data/containers_content_expected_diff
+++ /dev/null
@@ -1,3 +0,0 @@
-@@ -1 +1 @@
--Some content.
-+Some content!
diff --git a/tests/data/containers_filelist_expected_diff b/tests/data/containers_filelist_expected_diff
index 8692ed0..b358fe6 100644
--- a/tests/data/containers_filelist_expected_diff
+++ b/tests/data/containers_filelist_expected_diff
@@ -1,8 +1,8 @@
-@@ -1,5 +1,5 @@
--t0/
--t0/t00/
- t0/t00/test2
-+t0/t00
- t0/test2.lnk
- t0/test1
-+t0
+@@ -1,4 +1,4 @@
+-dir/
+-dir/text
+-dir/null
+ dir/link
++dir/null
++dir/text
++dir
diff --git a/tests/data/test3.cpio b/tests/data/test3.cpio
deleted file mode 100644
index 046f59b..0000000
Binary files a/tests/data/test3.cpio and /dev/null differ
diff --git a/tests/data/test3.tar b/tests/data/test3.tar
deleted file mode 100644
index 412be12..0000000
Binary files a/tests/data/test3.tar and /dev/null differ

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


More information about the diffoscope mailing list