Esempio n. 1
0
 def test_most_popular_applications_for_mimetype(self):
     pathname = "../data/xapian"
     if not os.listdir(pathname):
         rebuild_database(pathname)
     db = StoreDatabase(pathname, self.cache)
     db.open()
     # all
     result = db.get_most_popular_applications_for_mimetype("text/html", only_uninstalled=False, num=5)
     self.assertEqual(len(result), 5)
     # only_uninstaleld
     result = db.get_most_popular_applications_for_mimetype("text/html", only_uninstalled=True, num=2)
     self.assertEqual(len(result), 2)
Esempio n. 2
0
 def test_most_popular_applications_for_mimetype(self):
     pathname = os.path.join(REAL_DATA_DIR, "xapian")
     if not os.listdir(pathname):
         rebuild_database(pathname)
     db = StoreDatabase(pathname, self.cache)
     db.open()
     # all
     result = db.get_most_popular_applications_for_mimetype("text/html",
         only_uninstalled=False, num=5)
     self.assertEqual(len(result), 5)
     # only_uninstaleld
     result = db.get_most_popular_applications_for_mimetype("text/html",
         only_uninstalled=True, num=2)
     self.assertEqual(len(result), 2)