5
sys.path.insert(0,"../")
10
from softwarecenter.db.database import StoreDatabase
11
from softwarecenter.enums import *
13
class testDatabase(unittest.TestCase):
14
""" tests the store database """
17
# FIXME: create a fixture DB instead of using the system one
18
# but for now that does not matter that much, only if we
19
# call open the db is actually read and the path checked
20
self.db = StoreDatabase("/var/cache/software-center/xapian",
24
def test_comma_seperation(self):
26
querries = self.db._comma_expansion("apt,2vcard,7zip")
27
self.assertEqual(len(querries), 3)
29
querries = self.db._comma_expansion("apt,apt,apt")
30
self.assertEqual(len(querries), 1)
32
querries = self.db._comma_expansion(",,,apt,xxx,,,")
33
self.assertEqual(len(querries), 2)
35
querries = self.db._comma_expansion("??")
36
self.assertEqual(querries, None)
38
if __name__ == "__main__":
40
logging.basicConfig(level=logging.DEBUG)