def test_reviews_no_reviews_but_app_not_installed(self, mock_connected):
        mock_connected.return_value = True
        # No reviews found, and the app isn't installed
        self.rl.clear()
        self.rl.configure_reviews_ui()
        do_events()

        self.assertEmbeddedMessageLabel(
            _("This app has not been reviewed yet"),
            _('You need to install this before you can review it'))
    def test_reviews_no_reviews_offer_to_write_one(self, mock_connected):
        from softwarecenter.enums import PkgStates
        mock_connected.return_value = True
        # No reviews found, and the app is installed
        self.rl.clear()
        self.rl._parent.app_details.pkg_state = PkgStates.INSTALLED
        self.rl.configure_reviews_ui()
        do_events()

        self.assertEmbeddedMessageLabel(
            _('Got an opinion?'),
            _('Be the first to contribute a review for this application'))
    def test_reviews_offers_to_relax_language(self):
        # No reviews found, but there are some in other languages:
        self.rl.clear()
        self.rl.global_review_stats = Mock()
        self.rl.global_review_stats.ratings_total = 4
        self.rl.configure_reviews_ui()
        do_events()

        self.assertEmbeddedMessageLabel(
            _("This app has not been reviewed yet in your language"),
            _('Try selecting a different language, or even "Any language"'
            ' in the language dropdown'))
Esempio n. 4
0
 def test_deb_file_view_error(self):
     mock_options = get_mock_options()
     xapianpath = softwarecenter.paths.XAPIAN_BASE_PATH
     app = SoftwareCenterAppGtk3(
         softwarecenter.paths.datadir, xapianpath, mock_options)
     app.run(["./data/test_debs/gdebi-test1.deb"])
     # give it time
     for i in range(10):
         time.sleep(0.1)
         do_events()
         # its ok to break out early
         if (app.available_pane.app_details_view and
             app.available_pane.app_details_view.get_property("visible")):
             break
     # check that we are on the right page
     self.assertEqual(
         app.available_pane.get_current_page(), AvailablePane.Pages.DETAILS)
     # this is deb that is not installable
     action_button = app.available_pane.app_details_view.pkg_statusbar.button
     self.assertFalse(action_button.get_property("visible"))
 def test_spinner_available(self):
     from softwarecenter.ui.gtk3.panes.globalpane import get_test_window
     win = get_test_window()
     pane = win.get_data("pane")
     self.assertNotEqual(pane.spinner, None)
     do_events()
Esempio n. 6
0
 def test_spinner_available(self):
     from softwarecenter.ui.gtk3.panes.globalpane import get_test_window
     win = get_test_window()
     pane = win.get_data("pane")
     self.assertNotEqual(pane.spinner, None)
     do_events()