~ubuntuone-control-tower/software-center/trunk

« back to all changes in this revision

Viewing changes to tests/gtk3/test_purchase.py

  • Committer: CI Train Bot
  • Author(s): Iain Lane
  • Date: 2016-02-17 13:47:35 UTC
  • mfrom: (3343.1.1 software-center)
  • Revision ID: ci-train-bot@canonical.com-20160217134735-8ed8171e5ypkuecx
Port to WebKit 2 Fixes: #1469221
Approved by: Iain Lane

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
class TestPurchase(unittest.TestCase):
19
19
 
20
 
    def test_purchase_view_log_cleaner(self):
21
 
        win = get_test_window_purchaseview()
22
 
        self.addCleanup(win.destroy)
23
 
        do_events_with_sleep()
24
 
        # get the view
25
 
        view = win.get_data("view")
26
 
        # install the mock
27
 
        purchaseview.LOG = mock = Mock()
28
 
        # run a "harmless" log message and ensure its logged normally
29
 
        view.wk.webkit.execute_script('console.log("foo")')
30
 
        self.assertTrue("foo" in mock.debug.call_args[0][0])
31
 
        mock.reset_mock()
32
 
 
33
 
        # run a message that contains token info
34
 
        s = ('http://sca.razorgirl.info/subscriptions/19077/checkout_complete/'
35
 
            ' @10: {"token_key": "hiddenXXXXXXXXXX", "consumer_secret": '
36
 
            '"hiddenXXXXXXXXXXXX", "api_version": 2.0, "subscription_id": '
37
 
            '19077, "consumer_key": "rKhNPBw", "token_secret": '
38
 
            '"hiddenXXXXXXXXXXXXXXX"}')
39
 
        view.wk.webkit.execute_script("console.log('%s')" % s)
40
 
        self.assertTrue("skipping" in mock.debug.call_args[0][0])
41
 
        self.assertFalse("consumer_secret" in mock.debug.call_args[0][0])
42
 
        mock.reset_mock()
43
 
 
44
20
    def test_purchase_view_tos(self):
45
21
        win = get_test_window_purchaseview()
46
22
        self.addCleanup(win.destroy)