Exemplo n.º 1
0
 def runTest(self):
     testl = ['make', 'save', 'get', 'del', 'make']
     db = Database(":memory:", default.stubs)
     db.mkschema()
     tabkey = [('place', default.places, Place),
               ('portal', default.portals, Portal),
               ('thing', default.things, Thing),
               ('color', default.colors, Color),
               ('style', default.styles, Style),
               ('attribute', default.attributes, AttrCheck),
               ('attribution', default.attributions, Attribution)]
     for pair in tabkey:
         suf = pair[0]
         for val in pair[1]:
             for test in testl:
                 print "Testing %s%s" % (test, suf)
                 self.testSomething(db, suf, pair[2],
                                    val[0], val[1], test)
Exemplo n.º 2
0
            self.assertEqual(obj, jbo)
        elif testname == 'del':
            killer = getattr(db, 'del' + suf)
            writer(*mkargs)
            self.assertTrue(knower(*keytup))
            killer(*keytup)
            self.assertFalse(knower(*keytup))

    def runTest(self):
        testl = ['make', 'save', 'get', 'del', 'make']
        db = Database(":memory:", default.stubs)
        db.mkschema()
        tabkey = [('place', default.places, Place),
                  ('portal', default.portals, Portal),
                  ('thing', default.things, Thing),
                  ('color', default.colors, Color),
                  ('style', default.styles, Style),
                  ('attribute', default.attributes, AttrCheck),
                  ('attribution', default.attributions, Attribution)]
        for pair in tabkey:
            suf = pair[0]
            for val in pair[1]:
                for test in testl:
                    print "Testing %s%s" % (test, suf)
                    self.testSomething(db, suf, pair[2],
                                       val[0], val[1], test)

db = Database(":memory:")
db.mkschema()
db.insert_defaults(default)