示例#1
0
 def test_find_card_without_id(self):
     card = Card(api_key='api_key')
     with self.assertRaises(ValueError):
         card.find_by_id()
示例#2
0
 def test_find_card_by_id(self):
     card = Card(api_key='api_key', id='cardid34j23l4')
     card.find_by_id()
     self.assertEqual(card.data['last_digits'], '8048')
示例#3
0
 def test_find_card_by_id_fail(self):
     card = Card(api_key='api_key', id='cardid34j23l4')
     with self.assertRaises(PagarmeApiError):
         card.find_by_id()
示例#4
0
 def test_create_card(self):
     card = Card(api_key='api_key', card_hash='hashcardlong')
     card.create()
示例#5
0
 def test_create_card_with_data(self):
     card = Card(api_key='api_key',
                 card_number='4111111111111111',
                 expiration_date=1215,
                 holder_name='Test User')
     card.create()
示例#6
0
 def test_find_card_without_id(self):
     card = Card(api_key='api_key')
     with self.assertRaises(ValueError):
         card.find_by_id()
示例#7
0
 def test_find_card_by_id_fail(self):
     card = Card(api_key='api_key', id='cardid34j23l4')
     with self.assertRaises(PagarmeApiError):
         card.find_by_id()
示例#8
0
 def test_find_card_by_id(self):
     card = Card(api_key='api_key', id='cardid34j23l4')
     card.find_by_id()
     self.assertEqual(card.data['last_digits'], '8048')
示例#9
0
 def test_create_card_with_data(self):
     card = Card(api_key='api_key', card_number='4111111111111111', expiration_date=1215, holder_name='Test User')
     card.create()
示例#10
0
 def test_create_card(self):
     card = Card(api_key='api_key', card_hash='hashcardlong')
     card.create()