diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-12-18 19:41:02 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-12-18 19:41:02 +0000 |
commit | 2da551bbcc6cab296769c193b0b82aaa6256cece (patch) | |
tree | d9b11a9a17c068c703d3c0f4bfb374ab6b31eb26 /lib/tdb/python | |
parent | 2a61fd41e9d4d2e3d7b47a816544c88bb369bc03 (diff) | |
download | samba-2da551bbcc6cab296769c193b0b82aaa6256cece.tar.gz samba-2da551bbcc6cab296769c193b0b82aaa6256cece.tar.bz2 samba-2da551bbcc6cab296769c193b0b82aaa6256cece.zip |
Implement missing functions in pytdb.
Diffstat (limited to 'lib/tdb/python')
-rw-r--r-- | lib/tdb/python/tests/simple.py | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/lib/tdb/python/tests/simple.py b/lib/tdb/python/tests/simple.py index c6999d8c7f..d242e665be 100644 --- a/lib/tdb/python/tests/simple.py +++ b/lib/tdb/python/tests/simple.py @@ -80,18 +80,6 @@ class SimpleTdbTests(TestCase): self.tdb["brainslug"] = "2" self.assertEquals(["bla", "brainslug"], list(self.tdb)) - def test_items(self): - self.tdb["bla"] = "1" - self.tdb["brainslug"] = "2" - self.assertEquals([("bla", "1"), ("brainslug", "2")], self.tdb.items()) - - def test_iteritems(self): - self.tdb["bloe"] = "2" - self.tdb["bla"] = "25" - i = self.tdb.iteritems() - self.assertEquals(set([("bla", "25"), ("bloe", "2")]), - set([i.next(), i.next()])) - def test_transaction_cancel(self): self.tdb["bloe"] = "2" self.tdb.transaction_start() @@ -112,39 +100,23 @@ class SimpleTdbTests(TestCase): 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_iterkeys(self): self.tdb["bloe"] = "2" self.tdb["bla"] = "25" i = self.tdb.iterkeys() self.assertEquals(set(["bloe", "bla"]), set([i.next(), i.next()])) - def test_values(self): - self.tdb["bloe"] = "2" - self.tdb["bla"] = "25" - self.assertEquals(["25", "2"], self.tdb.values()) - - def test_itervalues(self): - self.tdb["bloe"] = "2" - self.tdb["bla"] = "25" - i = self.tdb.itervalues() - self.assertEquals(set(["25", "2"]), set([i.next(), i.next()])) - def test_clear(self): self.tdb["bloe"] = "2" self.tdb["bla"] = "25" - self.assertEquals(2, len(self.tdb)) + self.assertEquals(2, len(list(self.tdb))) self.tdb.clear() - self.assertEquals(0, len(self.tdb)) + self.assertEquals(0, len(list(self.tdb))) def test_len(self): - self.assertEquals(0, len(self.tdb)) + self.assertEquals(0, len(list(self.tdb))) self.tdb["entry"] = "value" - self.assertEquals(1, len(self.tdb)) + self.assertEquals(1, len(list(self.tdb))) if __name__ == '__main__': |