From 7a59c90189b3b129c4cf9826a45ac5678e66d95b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 19 Sep 2010 10:42:29 -0700 Subject: pytdb: Make filename argument optional. --- lib/tdb/python/tests/simple.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/tdb/python/tests/simple.py') 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('')") + self.assertEquals(repr(self.tdb), "Tdb()") 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" -- cgit