(self)
| 1917 | |
| 1918 | @support.requires_zlib() |
| 1919 | def test_make_archive_owner_group(self): |
| 1920 | # testing make_archive with owner and group, with various combinations |
| 1921 | # this works even if there's not gid/uid support |
| 1922 | if UID_GID_SUPPORT: |
| 1923 | group = grp.getgrgid(0)[0] |
| 1924 | owner = pwd.getpwuid(0)[0] |
| 1925 | else: |
| 1926 | group = owner = 'root' |
| 1927 | |
| 1928 | root_dir, base_dir = self._create_files() |
| 1929 | base_name = os.path.join(self.mkdtemp(), 'archive') |
| 1930 | res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner, |
| 1931 | group=group) |
| 1932 | self.assertTrue(os.path.isfile(res)) |
| 1933 | |
| 1934 | res = make_archive(base_name, 'zip', root_dir, base_dir) |
| 1935 | self.assertTrue(os.path.isfile(res)) |
| 1936 | |
| 1937 | res = make_archive(base_name, 'tar', root_dir, base_dir, |
| 1938 | owner=owner, group=group) |
| 1939 | self.assertTrue(os.path.isfile(res)) |
| 1940 | |
| 1941 | res = make_archive(base_name, 'tar', root_dir, base_dir, |
| 1942 | owner='kjhkjhkjg', group='oihohoh') |
| 1943 | self.assertTrue(os.path.isfile(res)) |
| 1944 | |
| 1945 | |
| 1946 | @support.requires_zlib() |
nothing calls this directly
no test coverage detected