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

« back to all changes in this revision

Viewing changes to tests/gtk3/test_appmanager.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-10-11 15:33:05 UTC
  • mfrom: (195.1.18 quantal)
  • Revision ID: package-import@ubuntu.com-20121011153305-fm5ln7if3rpzts4n
Tags: 5.4.1.1
* lp:~mvo/software-center/reinstall-previous-purchase-token-fix:
  - fix reinstall previous purchases that have a system-wide
    license key LP: #1065481
* lp:~mvo/software-center/lp1060106:
  - Add missing gettext init for utils/update-software-center-agent
    (LP: #1060106)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import unittest
2
2
 
3
 
from mock import Mock
 
3
from mock import (
 
4
    Mock,
 
5
    patch,
 
6
    )
4
7
 
5
8
from tests.utils import (
6
9
    do_events,
76
79
    def _on_purchase_requested(self, *args):
77
80
        self._purchase_requested_signal = True
78
81
 
 
82
    def test_appmanager_requests_oauth_token(self):
 
83
        oauth_token = { "moo": "bar",
 
84
                        "lala": "la",
 
85
                        }
 
86
        # reset the global appmanager
 
87
        softwarecenter.ui.gtk3.session.appmanager._appmanager = None
 
88
        with patch("softwarecenter.ui.gtk3.session.appmanager.UbuntuSSO"
 
89
                   ".find_oauth_token_sync") as m:
 
90
            m.return_value = oauth_token
 
91
            app_manager = ApplicationManager(self.db, self.backend, self.icons)
 
92
            self.assertEqual(app_manager.oauth_token, oauth_token)
 
93
 
 
94
 
79
95
if __name__ == "__main__":
80
96
    unittest.main()