summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-09-16 14:18:51 +0200
committerJelmer Vernooij <jelmer@samba.org>2012-09-16 15:58:04 +0200
commitc0d4f2462f75e0bc0545402b76984b4e6fcb13f1 (patch)
tree03ca71b2ee0775e0e5ab77ddace58fd1c5936c1e /source4/scripting/python/samba/tests
parent0ff2ea56d97cd8df7abeea8e819d7ec0bfd5b886 (diff)
downloadsamba-c0d4f2462f75e0bc0545402b76984b4e6fcb13f1.tar.gz
samba-c0d4f2462f75e0bc0545402b76984b4e6fcb13f1.tar.xz
samba-c0d4f2462f75e0bc0545402b76984b4e6fcb13f1.zip
s4-python: Formatting fixes, break lines.
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Sun Sep 16 15:58:04 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/scripting/python/samba/tests')
-rw-r--r--source4/scripting/python/samba/tests/dns.py5
-rw-r--r--source4/scripting/python/samba/tests/gensec.py2
-rw-r--r--source4/scripting/python/samba/tests/hostconfig.py4
-rw-r--r--source4/scripting/python/samba/tests/messaging.py2
-rw-r--r--source4/scripting/python/samba/tests/posixacl.py6
-rw-r--r--source4/scripting/python/samba/tests/provision.py12
-rw-r--r--source4/scripting/python/samba/tests/registry.py2
-rw-r--r--source4/scripting/python/samba/tests/samba3.py1
8 files changed, 23 insertions, 11 deletions
diff --git a/source4/scripting/python/samba/tests/dns.py b/source4/scripting/python/samba/tests/dns.py
index 8815474061..3eee306d43 100644
--- a/source4/scripting/python/samba/tests/dns.py
+++ b/source4/scripting/python/samba/tests/dns.py
@@ -112,7 +112,9 @@ class DNSTest(TestCase):
if s is not None:
s.close()
+
class TestSimpleQueries(DNSTest):
+
def test_one_a_query(self):
"create a query packet containing one query record"
p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
@@ -240,6 +242,7 @@ class TestSimpleQueries(DNSTest):
class TestDNSUpdates(DNSTest):
+
def test_two_updates(self):
"create two update requests"
p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
@@ -429,7 +432,6 @@ class TestDNSUpdates(DNSTest):
self.assertEquals(response.ancount, 1)
self.assertEquals(response.answers[0].rdata.txt, '"This is a test" "and this is a test, too"')
-
def test_delete_record(self):
"Test if deleting records works"
p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
@@ -470,6 +472,7 @@ class TestDNSUpdates(DNSTest):
class TestComplexQueries(DNSTest):
+
def setUp(self):
super(TestComplexQueries, self).setUp()
p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
diff --git a/source4/scripting/python/samba/tests/gensec.py b/source4/scripting/python/samba/tests/gensec.py
index 02302a8e11..712f177cfc 100644
--- a/source4/scripting/python/samba/tests/gensec.py
+++ b/source4/scripting/python/samba/tests/gensec.py
@@ -67,7 +67,7 @@ class GensecTests(samba.tests.TestCase):
client_finished = False
server_finished = False
server_to_client = ""
-
+
"""Run the actual call loop"""
while client_finished == False and server_finished == False:
if not client_finished:
diff --git a/source4/scripting/python/samba/tests/hostconfig.py b/source4/scripting/python/samba/tests/hostconfig.py
index 85cb1df0c1..526dc0fe4e 100644
--- a/source4/scripting/python/samba/tests/hostconfig.py
+++ b/source4/scripting/python/samba/tests/hostconfig.py
@@ -57,7 +57,9 @@ class ShareTests(TestCase):
def test_iter(self):
self.assertEquals([], list(self._get_shares({})))
self.assertEquals([], list(self._get_shares({"global":{}})))
- self.assertEquals(["bla"], list(self._get_shares({"global":{}, "bla":{}})))
+ self.assertEquals(
+ ["bla"],
+ list(self._get_shares({"global":{}, "bla":{}})))
def test_len(self):
shares = self._get_shares({"global": {}})
diff --git a/source4/scripting/python/samba/tests/messaging.py b/source4/scripting/python/samba/tests/messaging.py
index b6c9a0abbc..fd9aa8ef82 100644
--- a/source4/scripting/python/samba/tests/messaging.py
+++ b/source4/scripting/python/samba/tests/messaging.py
@@ -26,7 +26,7 @@ class MessagingTests(TestCase):
def get_context(self, *args, **kwargs):
return Messaging(*args, **kwargs)
-
+
def test_register(self):
x = self.get_context()
def callback():
diff --git a/source4/scripting/python/samba/tests/posixacl.py b/source4/scripting/python/samba/tests/posixacl.py
index b323f91f1a..066cc97373 100644
--- a/source4/scripting/python/samba/tests/posixacl.py
+++ b/source4/scripting/python/samba/tests/posixacl.py
@@ -18,10 +18,10 @@
"""Tests for the Samba3 NT -> posix ACL layer"""
-from samba.ntacls import setntacl, getntacl, XattrBackendError
+from samba.ntacls import setntacl, getntacl
from samba.dcerpc import xattr, security, smb_acl, idmap
from samba.param import LoadParm
-from samba.tests import TestCase, TestSkipped
+from samba.tests import TestCase
from samba import provision
import random
import os
@@ -34,7 +34,7 @@ from samba.samba3 import param as s3param
# print "a_perm: %o" % entry.a_perm
# print "uid: %d" % entry.uid
# print "gid: %d" % entry.gid
-
+
class PosixAclMappingTests(TestCase):
def test_setntacl(self):
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 9375f91b83..408c9883f3 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -135,9 +135,15 @@ class SanitizeServerRoleTests(TestCase):
self.assertRaises(ValueError, sanitize_server_role, "foo")
def test_valid(self):
- self.assertEquals("standalone server", sanitize_server_role("ROLE_STANDALONE"))
- self.assertEquals("standalone server", sanitize_server_role("standalone"))
- self.assertEquals("active directory domain controller", sanitize_server_role("domain controller"))
+ self.assertEquals(
+ "standalone server",
+ sanitize_server_role("ROLE_STANDALONE"))
+ self.assertEquals(
+ "standalone server",
+ sanitize_server_role("standalone"))
+ self.assertEquals(
+ "active directory domain controller",
+ sanitize_server_role("domain controller"))
class DummyLogger(object):
diff --git a/source4/scripting/python/samba/tests/registry.py b/source4/scripting/python/samba/tests/registry.py
index 73fe06dfb9..8016a0bb68 100644
--- a/source4/scripting/python/samba/tests/registry.py
+++ b/source4/scripting/python/samba/tests/registry.py
@@ -24,7 +24,7 @@ import samba.tests
class HelperTests(samba.tests.TestCase):
def test_predef_to_name(self):
- self.assertEquals("HKEY_LOCAL_MACHINE",
+ self.assertEquals("HKEY_LOCAL_MACHINE",
registry.get_predef_name(0x80000002))
def test_str_regtype(self):
diff --git a/source4/scripting/python/samba/tests/samba3.py b/source4/scripting/python/samba/tests/samba3.py
index 239a4b0dd7..d83db0f8b2 100644
--- a/source4/scripting/python/samba/tests/samba3.py
+++ b/source4/scripting/python/samba/tests/samba3.py
@@ -28,6 +28,7 @@ from samba.tests import TestCase, TestCaseInTempDir
from samba.dcerpc.security import dom_sid
import os
+
for p in [ "../../../../../testdata/samba3", "../../../../testdata/samba3" ]:
DATADIR = os.path.join(os.path.dirname(__file__), p)
if os.path.exists(DATADIR):