1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

s4-python: Various formatting fixes.

This commit is contained in:
Jelmer Vernooij
2012-02-18 23:59:48 +01:00
parent c29e0258e0
commit a977de9fdf
9 changed files with 42 additions and 59 deletions

View File

@ -27,15 +27,15 @@ class WinregTests(RpcInterfaceTestCase):
def setUp(self):
super(WinregTests, self).setUp()
self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(),
self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(),
self.get_credentials())
def get_hklm(self):
return self.conn.OpenHKLM(None,
return self.conn.OpenHKLM(None,
winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
def test_hklm(self):
handle = self.conn.OpenHKLM(None,
handle = self.conn.OpenHKLM(None,
winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
self.conn.CloseKey(handle)

View File

@ -37,6 +37,7 @@ import talloc
talloc.enable_null_tracking()
class TallocTests(samba.tests.TestCase):
'''test talloc behaviour of pidl generated python code'''
@ -54,7 +55,7 @@ class TallocTests(samba.tests.TestCase):
# we expect one block for the object, and one for the structure
self.check_blocks(partial_attribute_set, 2)
attids = [ 1, 2, 3]
attids = [1, 2, 3]
partial_attribute_set.version = 1
partial_attribute_set.attids = attids
partial_attribute_set.num_attids = len(attids)

View File

@ -67,6 +67,7 @@ class strcasecmp_m_Tests(samba.tests.TestCase):
class strstr_m_Tests(samba.tests.TestCase):
"""strstr_m tests in simple ASCII and unicode strings"""
def test_strstr_m(self):
# A, B, strstr_m(A, B)
cases = [('hello', 'hello', 'hello'),

View File

@ -22,6 +22,7 @@
from samba.upgrade import import_wins
from samba.tests import LdbTestCase
class WinsUpgradeTests(LdbTestCase):
def test_upgrade(self):
@ -30,10 +31,12 @@ class WinsUpgradeTests(LdbTestCase):
}
import_wins(self.ldb, winsdb)
self.assertEquals(['name=FOO,type=0x20'],
[str(m.dn) for m in self.ldb.search(expression="(objectClass=winsRecord)")])
self.assertEquals(
['name=FOO,type=0x20'],
[str(m.dn) for m in
self.ldb.search(expression="(objectClass=winsRecord)")])
def test_version(self):
import_wins(self.ldb, {})
self.assertEquals("VERSION",
self.assertEquals("VERSION",
str(self.ldb.search(expression="(objectClass=winsMaxVersion)")[0]["cn"]))

View File

@ -161,7 +161,8 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir):
self.assertNotEquals(oem, "")
def test_update_dns_account(self):
update_dns_account_password(self.ldbs.sam, self.ldbs.secrets, self.names)
update_dns_account_password(self.ldbs.sam, self.ldbs.secrets,
self.names)
def test_updateOEMInfo(self):
realm = self.lp.get("realm")

View File

@ -83,7 +83,7 @@ class XattrTests(TestCase):
ntacl.version = 1
open(tempf, 'w').write("empty")
try:
self.assertRaises(IOError, samba.xattr_tdb.wrap_setxattr,
self.assertRaises(IOError, samba.xattr_tdb.wrap_setxattr,
os.path.join("nonexistent", "eadb.tdb"), tempf,
"user.unittests", ndr_pack(ntacl))
finally: