本文整理汇总了Python中app.FizzBuzz.calc方法的典型用法代码示例。如果您正苦于以下问题:Python FizzBuzz.calc方法的具体用法?Python FizzBuzz.calc怎么用?Python FizzBuzz.calc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.FizzBuzz
的用法示例。
在下文中一共展示了FizzBuzz.calc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_V2_primes
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_V2_primes(self):
app = FizzBuzz()
self.failIf(app.calc(7) != "7 is a prime")
self.failIf(app.calc(11) != "11 is a prime")
self.failIf(app.calc(19) != "19 is a prime")
self.failIf(app.calc(23) != "23 is a prime")
self.failIf(app.calc(31) != "31 is a prime")
示例2: test_fizz
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_fizz(self):
app = FizzBuzz()
self.failIf(app.calc(6) != "Fizz")
self.failIf(app.calc(18) != "Fizz")
self.failIf(app.calc(99) != "Fizz")
示例3: test_primes
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_primes(self):
app = FizzBuzz()
for i in (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97):
self.failIf(app.calc(i) != "is a prime")
示例4: test_four
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_four(self):
app = FizzBuzz()
self.failIf(app.calc(30) != "FizzBuzz")
示例5: test_three
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_three(self):
app = FizzBuzz()
self.failIf(app.calc(10) != "Buzz")
示例6: test_two
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_two(self):
app = FizzBuzz()
self.failIf(app.calc(6) != "Fizz")
示例7: test_five
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_five(self):
app = FizzBuzz()
self.failIf(app.calc(15) != "FizzBuzz")
self.failIf(app.calc(30) != "FizzBuzz")
示例8: test_prime
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_prime(self):
app = FizzBuzz()
self.failIf(app.calc(3) != "3 is a prime")
self.failIf(app.calc(11) != "11 is a prime")
self.failIf(app.calc(97) != "97 is a prime")
示例9: test_V1_div35
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_V1_div35(self):
app = FizzBuzz()
self.failIf(app.calc(15) != "FizzBuzz")
self.failIf(app.calc(45) != "FizzBuzz")
示例10: test_V1_div5
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_V1_div5(self):
app = FizzBuzz()
self.failIf(app.calc(10) != "Buzz")
示例11: test_V1_div3
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_V1_div3(self):
app = FizzBuzz()
self.failIf(app.calc(9) != "Fizz")
示例12: test_buzz
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_buzz(self):
app=FizzBuzz()
self.failIf(app.calc(0) = "Buzz")
示例13: test_fizz
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_fizz(self):
app=FizzBuzz()
self.failIf(app.calc(9) = "Fizz")
示例14: test_prime
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_prime(self):
app = FizzBuzz()
self.failIf(app.calc(3) != "3 is a prime")
self.failIf(app.calc(83) != "83 is a prime")
示例15: test_5_7
# 需要导入模块: from app import FizzBuzz [as 别名]
# 或者: from app.FizzBuzz import calc [as 别名]
def test_5_7(self):
app = FizzBuzz()
self.failIf(app.calc(10) != "Buzz")
self.failIf(app.calc(20) != "Buzz")