1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-17 02:05:21 +03:00

r26107: Add more tests.

This commit is contained in:
Jelmer Vernooij 2007-11-25 03:04:04 +01:00 committed by Stefan Metzmacher
parent 7f1d38df05
commit afa5f7c9e9

View File

@ -95,3 +95,25 @@ class SimpleTdbTests(TestCase):
self.tdb["bla"] = "hoi"
i = iter(self.tdb)
self.assertEquals(set(["bloe", "bla"]), set([i.next(), i.next()]))
def test_keys(self):
self.tdb["bloe"] = "2"
self.tdb["bla"] = "25"
self.assertEquals(["bla", "bloe"], self.tdb.keys())
def test_values(self):
self.tdb["bloe"] = "2"
self.tdb["bla"] = "25"
self.assertEquals(["25", "2"], self.tdb.values())
def test_clear(self):
self.tdb["bloe"] = "2"
self.tdb["bla"] = "25"
self.assertEquals(2, len(self.tdb))
self.tdb.clear()
self.assertEquals(0, len(self.tdb))
def test_len(self):
self.assertEquals(0, len(self.tdb))
self.tdb["entry"] = "value"
self.assertEquals(1, len(self.tdb))