~diegosarmentero/ubuntuone-client/menu-separator

« back to all changes in this revision

Viewing changes to tests/platform/credentials/test_linux.py

  • Committer: Tarmac
  • Author(s): Facundo Batista
  • Date: 2012-09-07 21:56:47 UTC
  • mfrom: (1308.1.1 fix-1011822)
  • Revision ID: tarmac-20120907215647-34zt94b0hdgsozg6
Decode the gettext string before compare (LP: #1011822).

Show diffs side-by-side

added added

removed removed

Lines of Context:
384
384
        yield d
385
385
 
386
386
        self.assertEqual(self.sso_server._app_name, APP_NAME)
387
 
        params = dict(UI_PARAMS)
 
387
        # convert to unicode for the comparison, as the message is arriving
 
388
        # here as bytes (bad gettext usage!)
 
389
        params = dict((x, y.decode("utf8") if isinstance(y, str) else y)
 
390
                      for x, y in UI_PARAMS.items())
388
391
        params.update(self.args)
389
392
        self.assertEqual(self.sso_server._args, params)
390
393
 
397
400
        yield d
398
401
 
399
402
        self.assertEqual(self.sso_server._app_name, APP_NAME)
400
 
        params = dict(UI_PARAMS)
 
403
        # convert to unicode for the comparison, as the message is arriving
 
404
        # here as bytes (bad gettext usage!)
 
405
        params = dict((x, y.decode("utf8") if isinstance(y, str) else y)
 
406
                      for x, y in UI_PARAMS.items())
401
407
        params.update(self.args)
402
408
        self.assertEqual(self.sso_server._args, params)
403
409