~mmcg069/software-center/star-tweaks

« back to all changes in this revision

Viewing changes to test/test_database.py

  • Committer: Matthew McGowan
  • Date: 2011-04-02 00:09:53 UTC
  • mfrom: (1556.1.65 trunk)
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110402000953-uxeempz22lurkmms
merge w trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        self.cache = AptCache()
29
29
        self.cache.open()
30
30
 
31
 
    def test_comma_seperation(self):
32
 
        xapian_base_path = XAPIAN_BASE_PATH
33
 
        pathname = os.path.join(xapian_base_path, "xapian")
34
 
        db = StoreDatabase(pathname, self.cache)
35
 
        # normal
36
 
        querries = db._comma_expansion("apt,2vcard,7zip")
37
 
        self.assertEqual(len(querries), 3)
38
 
        # multiple identical
39
 
        querries = db._comma_expansion("apt,apt,apt")
40
 
        self.assertEqual(len(querries), 1)
41
 
        # too many commas
42
 
        querries = db._comma_expansion(",,,apt,xxx,,,")
43
 
        self.assertEqual(len(querries), 2)
44
 
        # invalid query
45
 
        querries = db._comma_expansion("??")
46
 
        self.assertEqual(querries, None)
47
 
 
48
31
    def test_update_from_desktop_file(self):
49
32
        # ensure we index with german locales to test i18n
50
33
        os.environ["LANGUAGE"] = "de"