From 21d333fbff93aeeb086ba05a52c26c56e9d99dc9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 3 Nov 2011 17:35:46 +0000 Subject: Include only files matching regexps, removes them from after adding them --- morphlib/bins_tests.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'morphlib/bins_tests.py') diff --git a/morphlib/bins_tests.py b/morphlib/bins_tests.py index 64858e7a..02706648 100644 --- a/morphlib/bins_tests.py +++ b/morphlib/bins_tests.py @@ -35,7 +35,7 @@ def recursive_lstat(root): if pathname == root: return '.' else: - return pathname[len(root):] + return pathname[len(root)+1:] def lstat(filename): st = os.lstat(filename) @@ -79,28 +79,28 @@ class ChunkTests(unittest.TestCase): def test_empties_everything(self): self.populate_instdir() - morphlib.bins.create_chunk(self.instdir, self.chunk_file, ['*']) + morphlib.bins.create_chunk(self.instdir, self.chunk_file, ['.']) empty = os.path.join(self.tempdir, 'empty') os.mkdir(empty) - self.assertEqual(recursive_lstat(self.instdir), empty) + self.assertEqual([x for x,y in recursive_lstat(self.instdir)], ['.']) def test_creates_and_unpacks_chunk_exactly(self): self.populate_instdir() orig_files = recursive_lstat(self.instdir) - morphlib.bins.create_chunk(self.instdir, self.chunk_file, ['*']) + morphlib.bins.create_chunk(self.instdir, self.chunk_file, ['.']) os.mkdir(self.unpacked) morphlib.bins.unpack_chunk(self.chunk_file, self.unpacked) self.assertEqual(orig_files, recursive_lstat(self.unpacked)) def test_uses_only_matching_names(self): self.populate_instdir() - morphlib.bins.create_chunk(self.instdir, self.chunk_file, ['bin/*']) + morphlib.bins.create_chunk(self.instdir, self.chunk_file, ['bin']) os.mkdir(self.unpacked) morphlib.bins.unpack_chunk(self.chunk_file, self.unpacked) self.assertEqual([x for x,y in recursive_lstat(self.unpacked)], - ['bin/foo']) + ['.', 'bin', 'bin/foo']) self.assertEqual([x for x,y in recursive_lstat(self.instdir)], - ['lib/libfoo.so']) + ['.', 'lib', 'lib/libfoo.so']) class StratumTests(unittest.TestCase): -- cgit v1.2.1