

def test_archive_subdir(self):
    '\n        Test git.archive on a subdir, giving only a partial copy of the repo in\n        the resulting archive\n        '
    tar_archive = os.path.join(integration.TMP, 'test_archive.tar.gz')
    self.assertTrue(self.run_function('git.archive', [os.path.join(self.repo, 'qux'), self], prefix='foo/'))
    self.assertTrue(tarfile.is_tarfile(tar_archive))
    with closing(tarfile.open(tar_archive, 'r')) as tar_obj:
        self.assertEqual(tar_obj.getnames(), ['foo', 'foo/bar', 'foo/baz', 'foo/foo'])
    os.unlink(tar_archive)

dataset/ETHPy150Open saltstack/salt/tests/integration/modules/git.py GitModuleTest.test_archive_subdir/VarMisuse@51/119 `tar_archive`->`self`