def test_actions_on_disabled(self, p): """ disabled SoftChroot should not change args on apply and revoke """ sc = SoftChroot(None) a = sc.apply(p) self.assertEqual(a, p) r = sc.revoke(p) self.assertEqual(r, p)
def test_actions_on_disabled(self, p): """ softchroot: disabled SC, apply and revoke should not change args """ sc = SoftChroot(None) a = sc.apply(p) self.assertEqual(a, p) r = sc.revoke(p) self.assertEqual(r, p)
def test_apply_out_of_root(self, p, e): """ softchroot: apply to paths outside of the chroot """ chroot = '/tmp/' sc = SoftChroot(chroot) a = sc.apply(p) # !!! Important thing for compatibility with non-soft-chroot: # !!! the path outside of chroot should be the same, but with chroot prefix!! self.assertEqual(a, e)
def test_apply_out_of_root(self, p): """ apply SoftChroot to paths outside of the chroot """ sc = SoftChroot('/tmp/') a = sc.apply(p) self.assertEqual(a, '/')
def test_apply(self, p, e): """ apply SoftChroot """ sc = SoftChroot('/tmp/') a = sc.apply(p) self.assertEqual(a, e)
def test_apply_to_chroot_without_slash(self, chroot_root, path, exp): """ softchroot: apply to the chroot path without trailing slash """ sc = SoftChroot(chroot_root) a = sc.apply(path) self.assertEqual(a, exp)
def test_apply(self, p, e): """ softchroot: apply """ sc = SoftChroot('/tmp/') a = sc.apply(p) self.assertEqual(a, e)