示例#1
0
 def test_drink(self):
     customer = Customer()
     customer.buy_beer()
     customer.drink()
     self.assertEqual(customer.glass.content, 19)
示例#2
0
 def test_triple_one_off(self):
     customer = Customer()
     customer.buy_beer("triple")
     customer.down_in_one()
     self.assertEqual(customer.glass.content, 0)
示例#3
0
 def test_triple_quaff(self):
     customer = Customer()
     customer.buy_beer("triple")
     customer.quaff()
     self.assertEqual(customer.glass.content, 56)
示例#4
0
 def test_triple_drink(self):
     customer = Customer()
     customer.buy_beer("triple")
     customer.drink()
     self.assertEqual(customer.glass.content, 59)
示例#5
0
 def test_half_quaff(self):
     customer = Customer()
     customer.buy_beer("half")
     customer.quaff()
     self.assertEqual(customer.glass.content, 6)
示例#6
0
 def test_too_much(self):
     customer = Customer()
     customer.buy_beer()
     customer.down_in_one()
     self.assertEqual(customer.glass.content, 0)
     self.assertRaises(Exception, customer.quaff)