예제 #1
0
 def test_profile_raises(self):
     self.get_token.return_value = {'access_token': 'bee5'}
     self.get_profile.side_effect = verify.IdentificationError
     with pytest.raises(verify.IdentificationError):
         verify.fxa_identify('heya', self.CONFIG)
     self.get_token.assert_called_with('heya', self.CONFIG)
     self.get_profile.assert_called_with('bee5', self.CONFIG)
예제 #2
0
 def test_profile_raises(self):
     self.get_token.return_value = {'access_token': 'bee5'}
     self.get_profile.side_effect = verify.IdentificationError
     with pytest.raises(verify.IdentificationError):
         verify.fxa_identify('heya', self.CONFIG)
     self.get_token.assert_called_with('heya', self.CONFIG)
     self.get_profile.assert_called_with('bee5', self.CONFIG)
예제 #3
0
 def test_all_good(self):
     self.get_token.return_value = {'access_token': 'cafe'}
     self.get_profile.return_value = {'email': '*****@*****.**'}
     identity = verify.fxa_identify('heya', self.CONFIG)
     assert identity == {'email': '*****@*****.**'}
     self.get_token.assert_called_with('heya', self.CONFIG)
     self.get_profile.assert_called_with('cafe', self.CONFIG)
예제 #4
0
 def test_all_good(self):
     self.get_token.return_value = {'access_token': 'cafe'}
     self.get_profile.return_value = {'email': '*****@*****.**'}
     identity = verify.fxa_identify('heya', self.CONFIG)
     assert identity == {'email': '*****@*****.**'}
     self.get_token.assert_called_with('heya', self.CONFIG)
     self.get_profile.assert_called_with('cafe', self.CONFIG)
예제 #5
0
 def test_token_raises(self):
     self.get_token.side_effect = verify.IdentificationError
     with pytest.raises(verify.IdentificationError):
         verify.fxa_identify('heya', self.CONFIG)
     self.get_token.assert_called_with('heya', self.CONFIG)
     assert not self.get_profile.called
예제 #6
0
 def test_token_raises(self):
     self.get_token.side_effect = verify.IdentificationError
     with pytest.raises(verify.IdentificationError):
         verify.fxa_identify('heya', self.CONFIG)
     self.get_token.assert_called_with('heya', self.CONFIG)
     assert not self.get_profile.called