From 88f23a40979618c3eb5e09f55c67e8e9727be2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 8 Mar 2018 13:02:18 +0100 Subject: [PATCH] Also test bat pack --noop --- tests/test_pack.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_pack.py b/tests/test_pack.py index 6e9356b..c5c2dfd 100644 --- a/tests/test_pack.py +++ b/tests/test_pack.py @@ -132,3 +132,22 @@ class AbstractPackTest(AbstractBlendFileTest): self.assertEqual(b'//../linked_cube.blend', libs[0][b'name']) self.assertEqual(b'LILib.002', libs[1].id_name) self.assertEqual(b'//../material_textures.blend', libs[1][b'name']) + + def test_noop(self): + ppath = self.blendfiles / 'subdir' + infile = ppath / 'doubly_linked_up.blend' + + packer = pack.Packer(infile, ppath, self.tpath, noop=True) + packer.strategise() + packer.execute() + + self.assertEqual([], list(self.tpath.iterdir())) + + # The original file shouldn't be touched. + bfile = blendfile.open_cached(infile) + libs = sorted(bfile.code_index[b'LI']) + + self.assertEqual(b'LILib', libs[0].id_name) + self.assertEqual(b'//../linked_cube.blend', libs[0][b'name']) + self.assertEqual(b'LILib.002', libs[1].id_name) + self.assertEqual(b'//../material_textures.blend', libs[1][b'name'])