예제 #1
0
class StoreTest(TestCase):
  
  def setUp(self):
    self.store = Store()

  def testEmpty(self):
    r = self.store.reader()
    self.assertFalse(r.more(), "Empty store should be empty")

  def testPlain(self):
    self.store.put("hello")
    r = self.store.reader()
    self.assertTrue(r.more(), "Store should not be empty")
    e = r.next()
    self.assertFalse(r.more(), "Store should be empty")
    self.assertEqual("hello", str(e.message))
  def testGc(self):
    map(self.store.put, "A B C D E F".split())
    r = self.store.reader()
    r.next()
    r.next()
    r.next()
    self.store.gc()
예제 #2
0
class StoreTest(TestCase):
    def setUp(self):
        self.store = Store()

    def testEmpty(self):
        r = self.store.reader()
        self.assertFalse(r.more(), "Empty store should be empty")

    def testPlain(self):
        self.store.put("hello")
        r = self.store.reader()
        self.assertTrue(r.more(), "Store should not be empty")
        e = r.next()
        self.assertFalse(r.more(), "Store should be empty")
        self.assertEqual("hello", str(e.message))

    def testGc(self):
        map(self.store.put, "A B C D E F".split())
        r = self.store.reader()
        r.next()
        r.next()
        r.next()
        self.store.gc()
예제 #3
0
 def __init__(self, name=None):
   Store.__init__(self, name)
예제 #4
0
 def setUp(self):
   self.store = Store()
예제 #5
0
 def __init__(self, name=None):
     Store.__init__(self, name)
예제 #6
0
 def setUp(self):
     self.store = Store()