~mvo/software-center/qml

« back to all changes in this revision

Viewing changes to test/test_where_is_it.py

  • Committer: Michael Vogt
  • Date: 2011-10-05 13:08:09 UTC
  • mfrom: (1887.1.603 software-center)
  • Revision ID: michael.vogt@ubuntu.com-20111005130809-0tin9nr00f0uw65b
mergedĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
sys.path.insert(0,"../")
7
7
 
8
8
from softwarecenter.paths import XAPIAN_BASE_PATH
9
 
from softwarecenter.utils import GMenuSearcher
 
9
from softwarecenter.ui.gtk3.gmenusearch import GMenuSearcher
10
10
from softwarecenter.db.pkginfo import get_pkg_info
11
11
from softwarecenter.db.database import StoreDatabase
12
12
from softwarecenter.db.application import Application
44
44
        app = Application("Calculator", "gcalctool")
45
45
        details = app.get_details(self.db)
46
46
        self.assertEqual(details.desktop_file, 
47
 
                         "/usr/share/app-install/desktop/gcalctool.desktop")
 
47
                         "/usr/share/app-install/desktop/gcalctool:gcalctool.desktop")
48
48
        # search the settings menu
49
49
        searcher = GMenuSearcher()
50
50
        found = searcher.get_main_menu_path(
51
51
            details.desktop_file,
52
52
            [os.path.abspath("./data/fake-applications.menu")])
53
53
        self.assertEqual(found[0].get_name(), "Applications")
54
 
        self.assertEqual(found[0].get_icon(), "applications-other")
 
54
        self.assertEqual(found[0].get_icon().get_names()[0], 
 
55
                         "applications-other")
55
56
        self.assertEqual(found[1].get_name(), "Accessories")
56
 
        self.assertEqual(found[1].get_icon(), "applications-utilities")
 
57
        self.assertEqual(found[1].get_icon().get_names()[0], 
 
58
                         "applications-utilities")
57
59
    
58
60
    def test_where_is_it_kde4(self):
59
61
        app = Application("", "ark")
60
62
        details = app.get_details(self.db)
61
63
        self.assertEqual(details.desktop_file, 
62
 
                         "/usr/share/app-install/desktop/kde4___ark.desktop")
 
64
                         "/usr/share/app-install/desktop/ark:kde4__ark.desktop")
63
65
        # search the settings menu
64
66
        searcher = GMenuSearcher()
65
67
        found = searcher.get_main_menu_path(
66
68
            details.desktop_file,
67
69
            [os.path.abspath("./data/fake-applications.menu")])
68
70
        self.assertEqual(found[0].get_name(), "Applications")
69
 
        self.assertEqual(found[0].get_icon(), "applications-other")
 
71
        self.assertEqual(found[0].get_icon().get_names()[0], 
 
72
                         "applications-other")
70
73
        self.assertEqual(found[1].get_name(), "Accessories")
71
 
        self.assertEqual(found[1].get_icon(), "applications-utilities")
 
74
        self.assertEqual(found[1].get_icon().get_names()[0], 
 
75
                         "applications-utilities")
72
76
        
73
77
 
74
78
if __name__ == "__main__":