def setUpClass(cls):
        # we can only have one instance of availablepane, so create it here
        cls.win = get_test_window_availablepane()
        cls.available_pane = cls.win.get_data("pane")

        # get the global config
        cls.config = get_config()

        # patch is_unity_running so that the test works inside a e.g.
        # ADT
        patch("softwarecenter.utils.is_unity_running").start().return_value = True
        patch("softwarecenter.backend.unitylauncher.UnityLauncher"
              "._get_launcher_dbus_iface").start().return_value = Mock()
Example #2
0
    def setUpClass(cls):
        # we can only have one instance of availablepane, so create it here
        cls.win = get_test_window_availablepane()
        cls.available_pane = cls.win.get_data("pane")

        # get the global config
        cls.config = get_config()

        # patch is_unity_running so that the test works inside a e.g.
        # ADT
        patch("softwarecenter.utils.is_unity_running").start(
        ).return_value = True
        patch("softwarecenter.backend.unitylauncher.UnityLauncher"
              "._get_launcher_dbus_iface").start().return_value = Mock()
Example #3
0
 def test_availablepane(self):
     win = get_test_window_availablepane()
     self.addCleanup(win.destroy)
     pane = win.get_data("pane")
     do_events_with_sleep()
     pane.on_search_terms_changed(None, "the")
     do_events_with_sleep()
     sortmode = pane.app_view.sort_methods_combobox.get_active_text()
     self.assertEqual(sortmode, "By Relevance")
     model = pane.app_view.tree_view.get_model()
     len1 = len(model)
     pane.on_search_terms_changed(None, "nosuchsearchtermforsure")
     do_events_with_sleep()
     len2 = len(model)
     self.assertTrue(len2 < len1)
Example #4
0
    def test_custom_lists(self):
        win = get_test_window_availablepane()
        self.addCleanup(win.destroy)
        pane = win.get_data("pane")
        do_events_with_sleep()
        pane.on_search_terms_changed(None, "ark,artha,software-center")
        do_events_with_sleep()
        model = pane.app_view.tree_view.get_model()

        # custom list should return three items
        self.assertTrue(len(model) == 3)

        # check package names, ordering is default "by relevance"
        self.assertPkgInListAtIndex(0, model, "ark")
        self.assertPkgInListAtIndex(1, model, "artha")
        self.assertPkgInListAtIndex(2, model, "software-center")

        # check that the status bar offers to install the packages
        install_button = pane.action_bar.get_button(ActionButtons.INSTALL)
        self.assertNotEqual(install_button, None)
Example #5
0
    def test_custom_lists(self):
        win = get_test_window_availablepane()
        self.addCleanup(win.destroy)
        pane = win.get_data("pane")
        do_events_with_sleep()
        pane.on_search_terms_changed(None, "ark,artha,software-center")
        do_events_with_sleep()
        model = pane.app_view.tree_view.get_model()

        # custom list should return three items
        self.assertTrue(len(model) == 3)

        # check package names, ordering is default "by relevance"
        self.assertPkgInListAtIndex(0, model, "ark")
        self.assertPkgInListAtIndex(1, model, "artha")
        self.assertPkgInListAtIndex(2, model, "software-center")

        # check that the status bar offers to install the packages
        install_button = pane.action_bar.get_button(ActionButtons.INSTALL)
        self.assertNotEqual(install_button, None)
Example #6
0
 def setUp(self):
     win = get_test_window_availablepane()
     self.addCleanup(win.destroy)
     self.pane = win.get_data("pane")
     self.vm = win.get_data("vm")
Example #7
0
 def setUp(self):
     win = get_test_window_availablepane()
     self.addCleanup(win.destroy)
     self.pane = win.get_data("pane")
     self.vm = win.get_data("vm")
 def setUpClass(cls):
     # we can only have one instance of availablepane, so create it here
     cls.win = get_test_window_availablepane()
     cls.available_pane = cls.win.get_data("pane")
Example #9
0
 def test_availablepane(self):
     win = windows.get_test_window_availablepane()
     self.addCleanup(win.destroy)
Example #10
0
 def test_availablepane(self):
     win = windows.get_test_window_availablepane()
     self.addCleanup(win.destroy)
 def setUpClass(cls):
     # we can only have one instance of availablepane, so create it here
     cls.win = get_test_window_availablepane()
     cls.available_pane = cls.win.get_data("pane")