summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-11-25 03:04:04 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:06 +0100
commit86be3d2f61f29e035277e4b4cfaec6a20a3ec85e (patch)
tree0119783c435cb9c7bffb797de543b54e1b97f544 /source4
parente4168bb0e0a9b4837ce18b19a2d43a8ae846d2d6 (diff)
downloadsamba-86be3d2f61f29e035277e4b4cfaec6a20a3ec85e.tar.gz
samba-86be3d2f61f29e035277e4b4cfaec6a20a3ec85e.tar.bz2
samba-86be3d2f61f29e035277e4b4cfaec6a20a3ec85e.zip
r26107: Add more tests.
(This used to be commit afa5f7c9e9fe29aaec0a5e3f9cda9d7567b3b254)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tdb/python/tests/simple.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/lib/tdb/python/tests/simple.py b/source4/lib/tdb/python/tests/simple.py
index 43d066c4a3..4600f02f14 100644
--- a/source4/lib/tdb/python/tests/simple.py
+++ b/source4/lib/tdb/python/tests/simple.py
@@ -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))