diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-11-03 17:35:46 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-11-03 17:35:46 +0000 |
commit | 21d333fbff93aeeb086ba05a52c26c56e9d99dc9 (patch) | |
tree | 25ab1890b06b7debad9c721aa6cbbee060d671ea /morphlib/bins_tests.py | |
parent | 222fcd9945e127d15282cd628e2e956500783213 (diff) | |
download | morph-21d333fbff93aeeb086ba05a52c26c56e9d99dc9.tar.gz |
Include only files matching regexps, removes them from after adding them
Diffstat (limited to 'morphlib/bins_tests.py')
-rw-r--r-- | morphlib/bins_tests.py | 14 |
1 files changed, 7 insertions, 7 deletions
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): |