From 866548cf186481ebe613067ced429ea80c3697fa Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Fri, 12 Oct 2018 11:38:27 +0200
Subject: [PATCH] tests: move dir-folder test data back here

and ensure it is included in the source package.

Related to T1265.
---
 MANIFEST.in                                       |   2 ++
 .../tests/data/dir-folders/sample-folder.tgz      | Bin 0 -> 555 bytes
 swh/model/tests/test_from_disk.py                 |   9 ++++-----
 3 files changed, 6 insertions(+), 5 deletions(-)
 create mode 100644 swh/model/tests/data/dir-folders/sample-folder.tgz

diff --git a/MANIFEST.in b/MANIFEST.in
index e7c46fca..99c8c1ac 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,6 @@
+include README.md
 include Makefile
 include requirements.txt
 include requirements-swh.txt
 include version.txt
+recursive-include swh/model/tests/data *.tgz
diff --git a/swh/model/tests/data/dir-folders/sample-folder.tgz b/swh/model/tests/data/dir-folders/sample-folder.tgz
new file mode 100644
index 0000000000000000000000000000000000000000..cc848944a0d3e71d287027347e25467e61b07428
GIT binary patch
literal 555
zcmV+`0@VE<iwFQ0D;8D&1MQhxZ<{a_fO+n(IB$Cy4BzncH0^!Tq`uR}Nvs+>GiGi6
zeGTiXxJj0qA)4Y(iiof!V?NF~#<X>_QX-!lH52wrHVUPOGu9swXXWPcFB!sB$tY$R
z<E%uOFq#1y=W;^2*3}jub4IWK)$dUIe@YwpZ%rfe2dQftbFPQ|v%x>*g!+fT`=<=^
z49bYtu$LS6FJ8ps-L)?waW%sDf2hZ(0mtTlAOB=Hj|l4HKjr`N+4k>$b7NvY2B-U{
zgeU)#u-AXBjav$v|LTkrg|UnC$LIxDl<xJ9&`1Bg;w07oDfkNa^3fT)hG*%PrgJc>
z^+H&XE!5zw?3&f`y=|d<&*Co6;fEB~3ixKM7E&p3?Rg~5BaHvZiT{n`^FL(_v7!F^
z=9K>@VB5bHDpyiJ<<8`PYQd#r4E}vVKiWU`<$`5^i(;c9#hC35lK&6><KOKQ{L^Z9
z|F1}iz5mhWXUYGT|6#$`7R@Z$7zfvXUUs<tWBz1X|4qTqr7;fX#)4n%Lt~6C;QMc(
zLC#@qI%s6ue(wK$QVLY9XHYjrFNWUzookD0&meILVf??>{is{O$LD{-F|PXeKZ2;w
z|Kn^&hunDl@Ae<J;+|0dOUzK8{}J{1ACFr2-$?#9{EKGg*3mx(p0WSOIZp3?Q?NV!
tgU!E-$2cMW3F*K8V!|sHtp8(fM~2+E|3o5@NF)-s$18>aRPO*N007JlGI#(0

literal 0
HcmV?d00001

diff --git a/swh/model/tests/test_from_disk.py b/swh/model/tests/test_from_disk.py
index 8e568ec2..432b1934 100644
--- a/swh/model/tests/test_from_disk.py
+++ b/swh/model/tests/test_from_disk.py
@@ -15,6 +15,9 @@ from swh.model.from_disk import Content, Directory, DentryPerms
 from swh.model.hashutil import DEFAULT_ALGORITHMS, hash_to_bytes, hash_to_hex
 
 
+TEST_DATA = os.path.join(os.path.dirname(__file__), 'data')
+
+
 class ModeToPerms(unittest.TestCase):
     def setUp(self):
         super().setUp()
@@ -466,11 +469,7 @@ class DataMixin:
             fn(path)
 
     def make_from_tarball(self, directory):
-        tarball = os.path.join(os.path.dirname(__file__),
-                               '../../../..',
-                               'swh-storage-testdata',
-                               'dir-folders',
-                               'sample-folder.tgz')
+        tarball = os.path.join(TEST_DATA, 'dir-folders', 'sample-folder.tgz')
 
         with tarfile.open(tarball, 'r:gz') as f:
             f.extractall(os.fsdecode(directory))
-- 
GitLab