summaryrefslogtreecommitdiff
path: root/lib/tdb/python/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-19 10:42:29 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-09-19 10:42:29 -0700
commit7a59c90189b3b129c4cf9826a45ac5678e66d95b (patch)
treef1224265fcca98e511339e1c307fd7198bc48ea5 /lib/tdb/python/tests
parent4c726556784643a3c5860ec716e30cc1c7b99ce1 (diff)
downloadsamba-7a59c90189b3b129c4cf9826a45ac5678e66d95b.tar.gz
samba-7a59c90189b3b129c4cf9826a45ac5678e66d95b.tar.bz2
samba-7a59c90189b3b129c4cf9826a45ac5678e66d95b.zip
pytdb: Make filename argument optional.
Diffstat (limited to 'lib/tdb/python/tests')
-rw-r--r--lib/tdb/python/tests/simple.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/tdb/python/tests/simple.py b/lib/tdb/python/tests/simple.py
index 7088235536..18180e16bd 100644
--- a/lib/tdb/python/tests/simple.py
+++ b/lib/tdb/python/tests/simple.py
@@ -18,6 +18,7 @@ class OpenTdbTests(TestCase):
tdb.DEFAULT, os.O_RDWR)
class CloseTdbTests(TestCase):
+
def test_double_close(self):
self.tdb = tdb.Tdb(tempfile.mkstemp()[1], 0, tdb.DEFAULT,
os.O_CREAT|os.O_RDWR)
@@ -29,11 +30,12 @@ class CloseTdbTests(TestCase):
class InternalTdbTests(TestCase):
+
def test_repr(self):
- self.tdb = tdb.Tdb("whatever", tdb_flags=tdb.INTERNAL)
+ self.tdb = tdb.Tdb()
# repr used to crash on internal db
- self.assertEquals(repr(self.tdb), "Tdb('<internal>')")
+ self.assertEquals(repr(self.tdb), "Tdb(<internal>)")
class SimpleTdbTests(TestCase):
@@ -127,12 +129,6 @@ class SimpleTdbTests(TestCase):
self.tdb.transaction_commit()
self.assertEquals("1", self.tdb["bloe"])
- def test_iterator(self):
- self.tdb["bloe"] = "2"
- self.tdb["bla"] = "hoi"
- i = iter(self.tdb)
- self.assertEquals(set(["bloe", "bla"]), set([i.next(), i.next()]))
-
def test_iterkeys(self):
self.tdb["bloe"] = "2"
self.tdb["bla"] = "25"