1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +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:
Douglas Bagnall 2015-09-17 11:35:55 +12:00 committed by Andrew Bartlett
parent fa2c6685c9
commit f26b227041

View File

@ -81,8 +81,8 @@ class SitesBaseTests(samba.tests.TestCase):
#tests on sites #tests on sites
class SimpleSitesTests(SitesBaseTests): class SimpleSitesTests(SitesBaseTests):
def test_create(self): def test_create_and_delete(self):
"""test creation of 1 site""" """test creation and deletion of 1 site"""
self.ldb_admin.transaction_start() self.ldb_admin.transaction_start()
ok = sites.create_site(self.ldb_admin, self.ldb_admin.get_config_basedn(), 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(), sites.create_site, self.ldb_admin, self.ldb_admin.get_config_basedn(),
"testsamba") "testsamba")
def test_delete(self):
"""test removal of 1 site"""
self.ldb_admin.transaction_start() self.ldb_admin.transaction_start()
ok = sites.delete_site(self.ldb_admin, self.ldb_admin.get_config_basedn(), ok = sites.delete_site(self.ldb_admin, self.ldb_admin.get_config_basedn(),
"testsamba") "testsamba")