mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
Rename TestSkipped to Skiptest, consistent with Python 2.7.
Change-Id: I023df54363328333f1cb6c3ae3c1a406befa8f7b Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
7cb7d4b53e
commit
940c277d83
@ -29,9 +29,9 @@ import tempfile
|
||||
import unittest
|
||||
|
||||
try:
|
||||
from unittest import SkipTest as TestSkipped
|
||||
from unittest import SkipTest
|
||||
except ImportError:
|
||||
class TestSkipped(Exception):
|
||||
class SkipTest(Exception):
|
||||
"""Test skipped."""
|
||||
|
||||
|
||||
|
@ -21,9 +21,7 @@
|
||||
|
||||
import samba
|
||||
import samba.tests
|
||||
from samba.tests import TestSkipped, TestCaseInTempDir
|
||||
|
||||
import errno
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
@ -36,6 +34,7 @@ class TestCase(samba.tests.TestCaseInTempDir):
|
||||
parameters.sort()
|
||||
return message + '\n\n %s' % ('\n '.join(parameters))
|
||||
|
||||
|
||||
def get_documented_parameters(sourcedir):
|
||||
path = os.path.join(sourcedir, "bin", "default", "docs-xml", "smbdotconf")
|
||||
if not os.path.exists(os.path.join(path, "parameters.all.xml")):
|
||||
|
@ -19,10 +19,9 @@
|
||||
"""Tests for samba.ntacls."""
|
||||
|
||||
from samba.ntacls import setntacl, getntacl, XattrBackendError
|
||||
from samba.dcerpc import xattr, security
|
||||
from samba.param import LoadParm
|
||||
from samba.tests import TestCaseInTempDir, TestSkipped
|
||||
import random
|
||||
from samba.dcerpc import security
|
||||
from samba.tests import TestCaseInTempDir, SkipTest
|
||||
import os
|
||||
|
||||
class NtaclsTests(TestCaseInTempDir):
|
||||
@ -64,7 +63,7 @@ class NtaclsTests(TestCaseInTempDir):
|
||||
|
||||
def test_setntacl_forcenative(self):
|
||||
if os.getuid() == 0:
|
||||
raise TestSkipped("Running test as root, test skipped")
|
||||
raise SkipTest("Running test as root, test skipped")
|
||||
lp = LoadParm()
|
||||
acl = "O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)"
|
||||
open(self.tempf, 'w').write("empty")
|
||||
|
@ -22,9 +22,9 @@ from samba.xattr import copytree_with_xattrs
|
||||
from samba.dcerpc import xattr
|
||||
from samba.ndr import ndr_pack
|
||||
from samba.tests import (
|
||||
SkipTest,
|
||||
TestCase,
|
||||
TestCaseInTempDir,
|
||||
TestSkipped,
|
||||
)
|
||||
import random
|
||||
import shutil
|
||||
@ -42,7 +42,7 @@ class XattrTests(TestCase):
|
||||
|
||||
def test_set_xattr_native(self):
|
||||
if not samba.xattr_native.is_xattr_supported():
|
||||
raise TestSkipped()
|
||||
raise SkipTest()
|
||||
ntacl = xattr.NTACL()
|
||||
ntacl.version = 1
|
||||
tempf = self._tmpfilename()
|
||||
@ -51,12 +51,12 @@ class XattrTests(TestCase):
|
||||
samba.xattr_native.wrap_setxattr(tempf, "user.unittests",
|
||||
ndr_pack(ntacl))
|
||||
except IOError:
|
||||
raise TestSkipped("the filesystem where the tests are runned do not support XATTR")
|
||||
raise SkipTest("the filesystem where the tests are runned do not support XATTR")
|
||||
os.unlink(tempf)
|
||||
|
||||
def test_set_and_get_native(self):
|
||||
if not samba.xattr_native.is_xattr_supported():
|
||||
raise TestSkipped()
|
||||
raise SkipTest()
|
||||
tempf = self._tmpfilename()
|
||||
reftxt = "this is a test"
|
||||
open(tempf, 'w').write("empty")
|
||||
@ -65,7 +65,7 @@ class XattrTests(TestCase):
|
||||
text = samba.xattr_native.wrap_getxattr(tempf, "user.unittests")
|
||||
self.assertEquals(text, reftxt)
|
||||
except IOError:
|
||||
raise TestSkipped("the filesystem where the tests are runned do not support XATTR")
|
||||
raise SkipTest("the filesystem where the tests are runned do not support XATTR")
|
||||
os.unlink(tempf)
|
||||
|
||||
def test_set_xattr_tdb(self):
|
||||
|
Loading…
Reference in New Issue
Block a user