~ubuntu-branches/ubuntu/precise/software-center/precise-proposed

« back to all changes in this revision

Viewing changes to test/gtk3/test_appstore2.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, Gary Lasker, Natalia Bidart
  • Date: 2012-06-28 10:35:55 UTC
  • Revision ID: package-import@ubuntu.com-20120628103555-grvde8fxjyrasdhj
Tags: 5.2.4
[ Michael Vogt ]
* lp:~mvo/software-center/lp970627:
  - fix intermittent crash when expunging the cache (LP: #970627)
* lp:~mvo/software-center/lp971776:
  - fix crash when a downloaded image is invalid for whatever
    reason (network issues, proxy issues, pay-wall in between)
    (LP: #971776)
* lp:~mvo/software-center/lp967036-2:
  - fix unicode error crash for people running with the
    LANGUAGE=zh_CN.UTF-8 or zh_TW.UTF-8 (LP: #967036)
* lp:~mvo/software-center/cookie-jar:
  - fix paypal support in the purchases window (LP: #1018347)

[ Gary Lasker ]
* debian/control:
  - update vcs link to point to the 5.2 branch 
* lp:~gary-lasker/software-center/previous-purchase-sorting-lp873104:
  - return correct results when sorting the list of previous
    purchases (LP: #873104)
* lp:~gary-lasker/software-center/recommendations-string-change-lp986437-for-5.2:
  - switch to the updated recommendations opt-in string now that the 
    corresponding language pack updates are released and available
    (LP: #986437)
* lp:~gary-lasker/software-center/fix-lp920741:
  - fix UnicodeDecodeError when a commercial app's title contains
    a unicode character (LP: #920741)

[ Natalia Bidart ]
* lp:~nataliabidart/software-center/cant-stop-the-music:
  - Stop the video if user navigates away from an app details page
    (LP: #1003954).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import xapian
5
5
 
6
6
from gi.repository import Gtk
7
 
from mock import patch
 
7
from mock import Mock, patch
8
8
 
9
9
from testutils import setup_test_env
10
10
setup_test_env()
16
16
                                      get_test_gtk3_icon_cache,
17
17
                                      )
18
18
 
19
 
class TestAppstore(unittest.TestCase):
 
19
class AppStoreTestCase(unittest.TestCase):
20
20
    """ test the appstore """
21
21
 
22
 
    def setUp(self):
23
 
        self.cache = get_test_pkg_info()
24
 
        self.icons = get_test_gtk3_icon_cache()
25
 
        self.db = get_test_db()
 
22
    @classmethod
 
23
    def setUpClass(cls):
 
24
        cls.cache = get_test_pkg_info()
 
25
        cls.icons = get_test_gtk3_icon_cache()
 
26
        cls.db = get_test_db()
26
27
 
27
28
    def test_lp872760(self):
28
29
        def monkey_(s):
68
69
        # ensure clear works
69
70
        model.clear()
70
71
        self.assertEqual(model.current_matches, None)
71
 
        
 
72
    
 
73
    def test_lp971776(self):
 
74
        """ ensure that refresh is not called for invalid image files """
 
75
        model = AppListStore(self.db, self.cache, self.icons)
 
76
        model.emit = Mock()
 
77
        model._on_image_download_complete(None, "xxx", "software-center")
 
78
        self.assertFalse(model.emit.called)
72
79
 
73
80
if __name__ == "__main__":
74
81
    import logging