本文整理汇总了Python中movie.Movie.addTicket方法的典型用法代码示例。如果您正苦于以下问题:Python Movie.addTicket方法的具体用法?Python Movie.addTicket怎么用?Python Movie.addTicket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类movie.Movie
的用法示例。
在下文中一共展示了Movie.addTicket方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testMovieWeekend
# 需要导入模块: from movie import Movie [as 别名]
# 或者: from movie.Movie import addTicket [as 别名]
def testMovieWeekend(self):
m = Movie(121, "Saturday", True, True)
m.addTicket(20,False)
price = m.finishPurchase()
self.assertEquals(price, 17.0)
示例2: testGoingWithLotsOfPeopleOnThursday
# 需要导入模块: from movie import Movie [as 别名]
# 或者: from movie.Movie import addTicket [as 别名]
def testGoingWithLotsOfPeopleOnThursday(self):
m = Movie(110, "Thursday", True, True)
for i in range(30):
m.addTicket(20+i,True)
price = m.finishPurchase()
self.assertEquals(price,30 * 9)
示例3: testMovie
# 需要导入模块: from movie import Movie [as 别名]
# 或者: from movie.Movie import addTicket [as 别名]
class testMovie(unittest.TestCase):
def setUp(self):
self.m = Movie(160,"Monday", True, True)
def testMovieBasic(self):
# addTicket (age, isStudent)
self.m.addTicket(30,False)
price = self.m.finishPurchase()
self.assertEquals(price,15.50)
def testMovieEldery(self):
self.m.addTicket(66, False)
price = self.m.finishPurchase()
self.assertEquals(price, 10.50)
def testMovieStudent(self):
self.m.addTicket(10, True)
price = self.m.finishPurchase()
self.assertEquals(price, 10.0)
def testMovieManyPeople(self):
for i in range(10):
self.m.addTicket(22, True)
price = self.m.finishPurchase()
self.assertEquals(price, 125.0)
def testMovieManyManyManyPeople(self):
for i in range(20):
self.m.addTicket(22, True)
price = self.m.finishPurchase()
self.assertEquals(price, 20*10.5 )
def testMovieThursday(self):
m = Movie(110, "Thursday", True, True)
m.addTicket(10,True)
price = m.finishPurchase()
self.assertEquals(price,6.5)
def testGoingWithLotsOfPeopleOnThursday(self):
m = Movie(110, "Thursday", True, True)
for i in range(30):
m.addTicket(20+i,True)
price = m.finishPurchase()
self.assertEquals(price,30 * 9)
def testMovieWeekend(self):
m = Movie(121, "Saturday", True, True)
m.addTicket(20,False)
price = m.finishPurchase()
self.assertEquals(price, 17.0)
示例4: testMovieThursday
# 需要导入模块: from movie import Movie [as 别名]
# 或者: from movie.Movie import addTicket [as 别名]
def testMovieThursday(self):
m = Movie(110, "Thursday", True, True)
m.addTicket(10,True)
price = m.finishPurchase()
self.assertEquals(price,6.5)