mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
modules.linux_acl: satisfy pylint
This commit is contained in:
parent
83b760db44
commit
fb5e86aaa1
@ -5,7 +5,7 @@ import os
|
||||
import shutil
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting.helpers import ensure_in_syspath, requires_salt_modules, skip_if_binaries_missing
|
||||
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
|
||||
import salt.utils
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
@ -67,4 +67,4 @@ class LinuxAclModuleTest(integration.ModuleCase,
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
run_tests(TestModuleTest)
|
||||
run_tests(LinuxAclModuleTest)
|
||||
|
@ -39,22 +39,22 @@ class LinuxAclTestCase(TestCase):
|
||||
|
||||
def test_getfacl_w_single_arg(self):
|
||||
linux_acl.getfacl(self.file)
|
||||
self.cmdrun.assert_called_once_with('getfacl -p {}'.format(self.file))
|
||||
self.cmdrun.assert_called_once_with('getfacl -p ' + self.file)
|
||||
|
||||
def test_getfacl_w_multiple_args(self):
|
||||
linux_acl.getfacl(*self.files)
|
||||
self.cmdrun.assert_called_once_with('getfacl -p {} {}'.format(*self.files))
|
||||
self.cmdrun.assert_called_once_with('getfacl -p ' + ' '.join(self.files))
|
||||
|
||||
def test_wipefacls_wo_args(self):
|
||||
self.assertRaises(CommandExecutionError, linux_acl.wipefacls)
|
||||
|
||||
def test_wipefacls_w_single_arg(self):
|
||||
linux_acl.wipefacls(self.file)
|
||||
self.cmdrun.assert_called_once_with('setfacl -b {}'.format(self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -b ' + self.file)
|
||||
|
||||
def test_wipefacls_w_multiple_args(self):
|
||||
linux_acl.wipefacls(*self.files)
|
||||
self.cmdrun.assert_called_once_with('setfacl -b {} {}'.format(*self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -b ' + ' '.join(self.files))
|
||||
|
||||
def test_modfacl_wo_args(self):
|
||||
for acl in [self.u_acl, self.user_acl, self.g_acl, self.group_acl]:
|
||||
@ -62,59 +62,59 @@ class LinuxAclTestCase(TestCase):
|
||||
|
||||
def test_modfacl__u_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.u_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.user_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.user_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__u_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.u_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.user_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.user_acl_cmd] + self.files))
|
||||
|
||||
def test_modfacl__user_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.user_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.user_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.user_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__user_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.user_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.user_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.user_acl_cmd] + self.files))
|
||||
|
||||
def test_modfacl__g_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.g_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.group_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.group_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__g_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.g_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.group_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.group_acl_cmd] + self.files))
|
||||
|
||||
def test_modfacl__group_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.group_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.group_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.group_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__group_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.group_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.group_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.group_acl_cmd] + self.files))
|
||||
|
||||
def test_modfacl__d_u_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.d_u_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.default_user_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.default_user_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__d_u_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.d_u_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.default_user_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.default_user_acl_cmd] + self.files))
|
||||
|
||||
def test_modfacl__d_user_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.d_user_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.default_user_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.default_user_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__d_user_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.d_user_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.default_user_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.default_user_acl_cmd] + self.files))
|
||||
|
||||
def test_modfacl__default_user_w_single_arg(self):
|
||||
linux_acl.modfacl(*(self.default_user_acl + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {}'.format(self.default_user_acl_cmd, self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.default_user_acl_cmd, self.file]))
|
||||
|
||||
def test_modfacl__default_user_w_multiple_args(self):
|
||||
linux_acl.modfacl(*(self.default_user_acl + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m {} {} {}'.format(self.default_user_acl_cmd, *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.default_user_acl_cmd] + self.files))
|
||||
|
||||
def test_delfacl_wo_args(self):
|
||||
for acl in [self.u_acl, self.user_acl, self.g_acl, self.group_acl]:
|
||||
@ -122,56 +122,56 @@ class LinuxAclTestCase(TestCase):
|
||||
|
||||
def test_delfacl__u_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.u_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.user_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.user_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__u_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.u_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.user_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.user_acl_cmd.rpartition(':')[0]] + self.files))
|
||||
|
||||
def test_delfacl__user_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.user_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.user_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.user_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__user_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.user_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.user_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.user_acl_cmd.rpartition(':')[0]] + self.files))
|
||||
|
||||
def test_delfacl__g_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.g_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.group_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.group_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__g_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.g_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.group_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.group_acl_cmd.rpartition(':')[0]] + self.files))
|
||||
|
||||
def test_delfacl__group_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.group_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.group_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.group_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__group_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.group_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.group_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.group_acl_cmd.rpartition(':')[0]] + self.files))
|
||||
|
||||
def test_delfacl__d_u_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.d_u_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.default_user_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.default_user_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__d_u_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.d_u_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.default_user_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.default_user_acl_cmd.rpartition(':')[0]] + self.files))
|
||||
|
||||
def test_delfacl__d_user_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.d_user_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.default_user_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.default_user_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__d_user_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.d_user_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.default_user_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.default_user_acl_cmd.rpartition(':')[0]] + self.files))
|
||||
|
||||
def test_delfacl__default_user_w_single_arg(self):
|
||||
linux_acl.delfacl(*(self.default_user_acl[:-1] + [self.file]))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {}'.format(self.default_user_acl_cmd.rpartition(':')[0], self.file))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.default_user_acl_cmd.rpartition(':')[0], self.file]))
|
||||
|
||||
def test_delfacl__default_user_w_multiple_args(self):
|
||||
linux_acl.delfacl(*(self.default_user_acl[:-1] + self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x {} {} {}'.format(self.default_user_acl_cmd.rpartition(':')[0], *self.files))
|
||||
self.cmdrun.assert_called_once_with('setfacl -x ' + ' '.join([self.default_user_acl_cmd.rpartition(':')[0]] + self.files))
|
Loading…
Reference in New Issue
Block a user