123456789101112131415161718192021 |
- def test_zip_extract(self):
- # Create some files in the temp dir:
- src = os.path.join(self.tmp, "src")
- os.mkdir(src)
- # Create a empty dir called a, and two files named
- # b and c
- a = os.path.join(src, "a")
- os.mkdir(a)
- b = os.path.join(a, "b")
- with open(b, "w") as fp:
- fp.write("b\n")
- c = os.path.join(a, "c")
- with open(c, "w") as fp:
- fp.write("c\n")
- archive = qibuild.archive.zip(a)
- dest = os.path.join(self.tmp, "dest")
- os.mkdir(dest)
- qibuild.archive.extract(archive, dest)
- ls_r = qibuild.sh.ls_r(dest)
- self.assertEquals(ls_r, ["a/b", "a/c"])
|