Example #1
0
 def test_in_case_decryption_fails_it_should_raise(self):
     self.request.headers = {AUTHORIZATION_HEADER: 'Browserid 1234',
                             CLIENT_STATE_HEADER: '12345'}
     tempered_cache = ENCRYPTED_CREDENTIALS.replace('0', 'a')
     with mock.patch('syncto.authentication.TokenserverClient') as TSClient:
         TSClient.return_value.get_hawk_credentials.return_value = \
             self.credentials
         with mock.patch.object(
                 self.request.registry.cache, 'get',
                 return_value=tempered_cache):
             self.assertRaises(CryptoError, build_sync_client, self.request)
 def test_in_case_decryption_fails_it_should_raise(self):
     self.request.headers = {
         AUTHORIZATION_HEADER: 'Browserid 1234',
         CLIENT_STATE_HEADER: '12345'
     }
     tempered_cache = ENCRYPTED_CREDENTIALS.replace('0', 'a')
     with mock.patch('syncto.authentication.TokenserverClient') as TSClient:
         TSClient.return_value.get_hawk_credentials.return_value = \
             self.credentials
         with mock.patch.object(self.request.registry.cache,
                                'get',
                                return_value=tempered_cache):
             self.assertRaises(CryptoError, build_sync_client, self.request)