Beispiel #1
0
 def test_debit_porte_monaie_solde_suffisant(self):
     caisse = Caisse()
     carte = mock()
     when(carte).getSolde().thenReturn(100)
     caisse.payerSansTicket(carte, 15)
     verify(carte).debiter(15)
 def test_debit_sans_ticket_solde_suffisant(self):
     caisse = Caisse()
     carte = Carte(150, 10, 8)
     caisse.payerSansTicket(carte, 15)
     self.assertEqual(135, carte.getSolde())
Beispiel #3
0
 def test_debit_porte_monnaie_solde_insuffisant(self):
     caisse = Caisse()
     carte = mock()
     when(carte).getSolde().thenReturn(10)
     with self.assertRaises(ValueError):
         caisse.payerSansTicket(carte, 15)
 def test_debit_sans_ticket_solde_insuffisant(self):
     caisse = Caisse()
     carte = Carte(2, 10, 8)
     with self.assertRaises(ValueError):
         caisse.payerSansTicket(carte, 15)