Exemplo n.º 1
0
 def test_update_from_appstream_xml(self):
     db = xapian.WritableDatabase("./data/test.db", xapian.DB_CREATE_OR_OVERWRITE)
     res = update_from_appstream_xml(db, self.cache, "./data/app-info/")
     self.assertTrue(res)
     self.assertEqual(db.get_doccount(), 1)
     # FIXME: improve tests
     for p in db.postlist(""):
         doc = db.get_document(p.docid)
         for term in doc.termlist():
             print term, term.term
         for value in doc.values():
             print value, value.num, value.value
Exemplo n.º 2
0
 def test_update_from_appstream_xml(self):
     db = xapian.WritableDatabase("./data/test.db", 
                                  xapian.DB_CREATE_OR_OVERWRITE)
     res = update_from_appstream_xml(db, self.cache, "./data/app-info/")
     self.assertTrue(res)
     self.assertEqual(db.get_doccount(), 1)
     # FIXME: improve tests
     for p in db.postlist(""):
         doc = db.get_document(p.docid)
         for term in doc.termlist():
             print term, term.term
         for value in doc.values():
             print value, value.num, value.value
 def test_update_from_appstream_xml(self):
     db = xapian.inmemory_open()
     res = update_from_appstream_xml(db, self.cache, os.path.join(DATA_DIR, "app-info"))
     self.assertTrue(res)
     self.assertEqual(db.get_doccount(), 1)
     # FIXME: improve tests
     for p in db.postlist(""):
         doc = db.get_document(p.docid)
         for term in doc.termlist():
             self.assertIsInstance(term, xapian.TermListItem)
             self.assertIsInstance(term.term, basestring)
         for value in doc.values():
             self.assertIsInstance(value, xapian.ValueItem)
             self.assertIsInstance(value.num, long)
             self.assertIsInstance(value.value, basestring)
 def test_update_from_appstream_xml(self):
     db = xapian.inmemory_open()
     res = update_from_appstream_xml(db, self.cache,
                                     os.path.join(DATA_DIR, "app-info"))
     self.assertTrue(res)
     self.assertEqual(db.get_doccount(), 1)
     # FIXME: improve tests
     for p in db.postlist(""):
         doc = db.get_document(p.docid)
         for term in doc.termlist():
             self.assertIsInstance(term, xapian.TermListItem)
             self.assertIsInstance(term.term, basestring)
         for value in doc.values():
             self.assertIsInstance(value, xapian.ValueItem)
             self.assertIsInstance(value.num, long)
             self.assertIsInstance(value.value, basestring)