summaryrefslogtreecommitdiff
path: root/tdb/python/tests
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-12-22 17:30:41 -0500
committerSimo Sorce <idra@samba.org>2008-12-22 18:52:37 -0500
commit9e1e585aa2740bd55bd60d965bd6c271ee9caa2e (patch)
tree02d225bc01207e2838e056a175d91f14576698dd /tdb/python/tests
parent6582952ae76c03c53227499028652b47692448e4 (diff)
downloadsssd-9e1e585aa2740bd55bd60d965bd6c271ee9caa2e.tar.gz
sssd-9e1e585aa2740bd55bd60d965bd6c271ee9caa2e.tar.bz2
sssd-9e1e585aa2740bd55bd60d965bd6c271ee9caa2e.zip
Rebase tdb code with all changes in samba master
Diffstat (limited to 'tdb/python/tests')
-rw-r--r--tdb/python/tests/simple.py38
1 files changed, 5 insertions, 33 deletions
diff --git a/tdb/python/tests/simple.py b/tdb/python/tests/simple.py
index 7147718c..d242e665 100644
--- a/tdb/python/tests/simple.py
+++ b/tdb/python/tests/simple.py
@@ -73,25 +73,13 @@ class SimpleTdbTests(TestCase):
self.tdb.map_size
def test_name(self):
- self.tdb.name
+ self.tdb.filename
def test_iterator(self):
self.tdb["bla"] = "1"
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__':