mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
dsdb.tests.sites: merge interdependent tests
The delete test deleted the site made by the create test, which worked because "delete" sorts after "create" alphabetically. By themselves, "delete" would fail and "create" would neglect its duty to clean up. This would be an issue if the order of tests changes, if one of the tests is not run, or if another test appears in between. Everything is fine if they give up the pretense of independence. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
fa2c6685c9
commit
f26b227041
@ -81,8 +81,8 @@ class SitesBaseTests(samba.tests.TestCase):
|
||||
#tests on sites
|
||||
class SimpleSitesTests(SitesBaseTests):
|
||||
|
||||
def test_create(self):
|
||||
"""test creation of 1 site"""
|
||||
def test_create_and_delete(self):
|
||||
"""test creation and deletion of 1 site"""
|
||||
|
||||
self.ldb_admin.transaction_start()
|
||||
ok = sites.create_site(self.ldb_admin, self.ldb_admin.get_config_basedn(),
|
||||
@ -93,9 +93,6 @@ class SimpleSitesTests(SitesBaseTests):
|
||||
sites.create_site, self.ldb_admin, self.ldb_admin.get_config_basedn(),
|
||||
"testsamba")
|
||||
|
||||
def test_delete(self):
|
||||
"""test removal of 1 site"""
|
||||
|
||||
self.ldb_admin.transaction_start()
|
||||
ok = sites.delete_site(self.ldb_admin, self.ldb_admin.get_config_basedn(),
|
||||
"testsamba")
|
||||
|
Loading…
Reference in New Issue
Block a user