mirror of
https://github.com/samba-team/samba.git
synced 2025-12-18 08:23:51 +03:00
netcmd: tests: tests tidyup and make use of setUpTestData
Still only load the test data once per test class, but much easier to read. Made several methods static for creating/deleting claims, policies and silos. Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
16c19c470e
commit
91fa5088b5
@@ -32,6 +32,9 @@ from samba.ndr import ndr_unpack
|
||||
|
||||
from .base import SambaToolCmdTest
|
||||
|
||||
HOST = "ldap://{DC_SERVER}".format(**os.environ)
|
||||
CREDS = "-U{DC_USERNAME}%{DC_PASSWORD}".format(**os.environ)
|
||||
|
||||
|
||||
class FieldTestMixin:
|
||||
"""Tests a model field to ensure it behaves correctly in both directions.
|
||||
@@ -39,11 +42,10 @@ class FieldTestMixin:
|
||||
Use a mixin since TestCase can't be marked as abstract.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.host = "ldap://{DC_SERVER}".format(**os.environ)
|
||||
self.creds = "-U{DC_USERNAME}%{DC_PASSWORD}".format(**os.environ)
|
||||
self.samdb = self.getSamDB("-H", self.host, self.creds)
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.samdb = cls.getSamDB("-H", HOST, CREDS)
|
||||
super().setUpClass()
|
||||
|
||||
def get_users_dn(self):
|
||||
"""Returns Users DN."""
|
||||
|
||||
Reference in New Issue
Block a user