From 86be3d2f61f29e035277e4b4cfaec6a20a3ec85e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 25 Nov 2007 03:04:04 +0100 Subject: r26107: Add more tests. (This used to be commit afa5f7c9e9fe29aaec0a5e3f9cda9d7567b3b254) --- source4/lib/tdb/python/tests/simple.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source4') 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)) -- cgit