~mvo/software-center/purchaseviewspinner

« back to all changes in this revision

Viewing changes to test/test_appdetails_view.py

  • Committer: Aaron Peachey
  • Date: 2011-06-03 06:08:15 UTC
  • mto: (1839.2.1 trunk) (1805.1.26 tests)
  • mto: This revision was merged to the branch mainline in revision 1861.
  • Revision ID: alpeachey@gmail.com-20110603060815-lq077p1ralhunt8g
create a fake get_usefulness() response and 
create a shortcut shell script to run in fake mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        datadir = "../data"
41
41
        softwarecenter.paths.datadir = datadir
42
42
        os.environ["PYTHONPATH"] = ".."
 
43
        os.environ["SOFTWARE_CENTER_FAKE_REVIEW_API"] = "1"
43
44
        # cache
44
45
        cache = get_pkg_info()
45
46
        cache.open()
195
196
        self.assertTrue(self.appdetails.reviews.new_review.get_property("visible"))
196
197
        
197
198
    def test_usefulness_submit_behaviour(self):
198
 
        os.environ["SOFTWARE_CENTER_FAKE_REVIEW_API"] = "1"
199
 
        app = Application("Compiz", "compiz-core")
 
199
        app = Application("3DChess", "3dchess")
200
200
        mock_app_details = self._get_mock_app_details()
201
201
        # monkey patch get_details() so that we get the mock object
202
202
        app.get_details = lambda db: mock_app_details
203
 
#        self.appdetails.review_loader = ReviewLoaderIpsum(self.appdetails.cache, self.appdetails.db)
204
203
        self.appdetails.show_app(app)
205
204
        self._p()
206
205
        time.sleep(2)
207
206
        self._p()
208
207
        win=gtk.Window(); win.add(self.appdetails); win.show()
209
208
        self._p()
 
209
        import pdb;pdb.set_trace()
210
210
        review_box = self.appdetails.reviews.vbox.get_children()[0]
211
211
        self.assertTrue(review_box.useful.get_property('visible'))
212
212
        self.assertFalse(review_box.submit_status_spinner.get_property('visible'))