()
| 196 | |
| 197 | |
| 198 | def test_chroot_zip_is_deterministic(): |
| 199 | # type: () -> None |
| 200 | with temporary_dir() as tmp: |
| 201 | root_dir = os.path.join(tmp, "root") |
| 202 | dir_a = os.path.join(root_dir, "a") |
| 203 | src_path_a = os.path.join(dir_a, "file_a") |
| 204 | touch(src_path_a) |
| 205 | dir_b = os.path.join(root_dir, "b") |
| 206 | src_path_b = os.path.join(dir_b, "file_b") |
| 207 | touch(src_path_b) |
| 208 | |
| 209 | chroot = Chroot(os.path.join(tmp, "chroot")) |
| 210 | chroot.symlink(root_dir, "root") |
| 211 | |
| 212 | zip_one_dst = os.path.join(tmp, "chroot_one.zip") |
| 213 | zip_two_dst = os.path.join(tmp, "chroot_two.zip") |
| 214 | |
| 215 | with mock.patch("os.walk", new=NonDeterministicWalk()): |
| 216 | chroot.zip(zip_one_dst) |
| 217 | chroot.zip(zip_two_dst) |
| 218 | |
| 219 | with open_zip(zip_one_dst) as zip_file: |
| 220 | namelist_one = zip_file.namelist() |
| 221 | |
| 222 | with open_zip(zip_two_dst) as zip_file: |
| 223 | namelist_two = zip_file.namelist() |
| 224 | |
| 225 | assert namelist_one == namelist_two |
| 226 | |
| 227 | |
| 228 | def test_chroot_zip_symlink(): |
nothing calls this directly
no test coverage detected