diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-10-17 20:25:59 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-10-17 20:25:59 +0100 |
commit | 7cba0a33cee244379cb2078b7c286c4de5c4f341 (patch) | |
tree | a8e9e7d264336f5adc495e3de0e7d665ccfe0ed0 /morphlib/bins_tests.py | |
parent | 0d62665119d13a113f92de18f918e850f4596f69 (diff) | |
download | morph-7cba0a33cee244379cb2078b7c286c4de5c4f341.tar.gz |
Add functions for creating and unpacking strata.
Diffstat (limited to 'morphlib/bins_tests.py')
-rw-r--r-- | morphlib/bins_tests.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/morphlib/bins_tests.py b/morphlib/bins_tests.py index b3c13a64..30076120 100644 --- a/morphlib/bins_tests.py +++ b/morphlib/bins_tests.py @@ -76,3 +76,27 @@ class ChunkTests(unittest.TestCase): self.assertEqual(recursive_lstat(self.instdir), recursive_lstat(self.unpacked)) + +class StratumTests(unittest.TestCase): + + def setUp(self): + self.tempdir = tempfile.mkdtemp() + self.instdir = os.path.join(self.tempdir, 'inst') + self.stratum_file = os.path.join(self.tempdir, 'stratum') + self.unpacked = os.path.join(self.tempdir, 'unpacked') + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def populate_instdir(self): + os.mkdir(self.instdir) + os.mkdir(os.path.join(self.instdir, 'bin')) + + def test_creates_and_unpacks_stratum_exactly(self): + self.populate_instdir() + morphlib.bins.create_stratum(self.instdir, self.stratum_file) + os.mkdir(self.unpacked) + morphlib.bins.unpack_stratum(self.stratum_file, self.unpacked) + self.assertEqual(recursive_lstat(self.instdir), + recursive_lstat(self.unpacked)) + |