本文整理汇总了Python中super_sum.super_sum函数的典型用法代码示例。如果您正苦于以下问题:Python super_sum函数的具体用法?Python super_sum怎么用?Python super_sum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了super_sum函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_sum_integers
def test_sum_integers(self):
"""
test the sum of integers
"""
self.assertEqual(super_sum(1,2,3), 6)
self.assertEqual(super_sum(-1, 1),0)
开发者ID:evamwangi,项目名称:Andela_bootcamp_vii,代码行数:7,代码来源:test_super_sum.py
示例2: test_sum_of_items_in_a_list
def test_sum_of_items_in_a_list(self):
"""
Tests sum of items in a single list
"""
self.assertEqual(super_sum([1, 2, 3]), 6)
self.assertEqual(super_sum([1, 2, 3],[1]), 7)
开发者ID:philliskiragu,项目名称:Bootcamp-7,代码行数:7,代码来源:test_super_sum.py
示例3: test_sum_of_integers
def test_sum_of_integers(self):
'''
Test sum of integers
'''
self.assertEqual(super_sum(1, 2, 3), 6)
self.assertEqual(super_sum(-1, 1), 0)
self.assertNotEqual(super_sum(10, 10, 30), 100)
开发者ID:Bopchy,项目名称:bootcamp7,代码行数:7,代码来源:test_super_sum.py
示例4: test_sum_of_elements_in_one_list
def test_sum_of_elements_in_one_list(self):
"""Test sum of items in a single list"""
#super_sum([1,2,3]) ==> 6
self.assertEqual(super_sum([-1, 1]), 0)
self.assertEqual(super_sum([1, 2, 3]), 6)
self.assertNotEqual(super_sum([10, 20, 30]), 100)
开发者ID:JoyWangari,项目名称:bootcamp-7,代码行数:7,代码来源:test_super_sum.py
示例5: test_sum_of_integers
def test_sum_of_integers(self):
"""
Tests sum of integers
"""
self.assertEqual(super_sum(1, 2, 3), 6)
self.assertNotEqual(super_sum(10, 20, 30), 100)
self.assertEqual(super_sum(-1 , 1), 0)
开发者ID:philliskiragu,项目名称:Bootcamp-7,代码行数:8,代码来源:test_super_sum.py
示例6: test_sum_of_integers
def test_sum_of_integers(self):
#test sum of integers
# super_sum(1,2,3) ==> 6
self.assertEqual(super_sum(1, 2, 3), 6)
self.assertEqual(super_sum(-1, 1,), 0)
self.assertNotEqual(super_sum(10, 20, 30), 100)
开发者ID:rosekay,项目名称:Bootcamp77,代码行数:9,代码来源:test_super_sum.py
示例7: test_empty_input
def test_empty_input(self):
#remember classes ~ because its a method in a class it takes self as argument
#self refers to the class, as in the class' objects
'''
Test empty input
'''
self.assertEqual(0, super_sum())
开发者ID:Bopchy,项目名称:bootcamp7,代码行数:7,代码来源:test_super_sum.py
示例8: test_sum_of_items_in_list
def test_sum_of_items_in_list(self):
"""
test the sum of integers in a single list
"""
self.assertEqual(super_sum([1,2,3]), 6)
开发者ID:evamwangi,项目名称:Andela_bootcamp_vii,代码行数:5,代码来源:test_super_sum.py
示例9: test_string_input
def test_string_input(self):
self.assertEqual (super_sum ('string', 1, 4 ), 0 )
开发者ID:gladnashah,项目名称:Bootcamp7,代码行数:2,代码来源:test_super_sum.py
示例10: test_sum_of_items_in_a_list
def test_sum_of_items_in_a_list(self):
self.assertEqual(super_sum([1, 2, 3]), 6)
开发者ID:Waihenya,项目名称:bootcamp-7,代码行数:2,代码来源:test_super_sum.py
示例11: test_string_input_returns
def test_string_input_returns(self):
"""
"""
self.assertEqual(super_sum('string', 1, 4) , 0)
开发者ID:evamwangi,项目名称:Andela_bootcamp_vii,代码行数:5,代码来源:test_super_sum.py
示例12: test_empty_input
def test_empty_input(self):
'''Test empty input.'''
self.assertEqual(0, super_sum())
开发者ID:PaulineNgugi2010,项目名称:bootcamp-7,代码行数:3,代码来源:test_super_sum.py
示例13: test_sum_of_integers
def test_sum_of_integers(self):
'''Test sum of integers.'''
self.assertEqual(super_sum(1,2,3), 6)
self.assertEqual(super_sum(-1, 1), 0)
开发者ID:PaulineNgugi2010,项目名称:bootcamp-7,代码行数:4,代码来源:test_super_sum.py
示例14: test_sum_of_items_in_one_list
def test_sum_of_items_in_one_list(self): #Test sum ofitems in a single list.
self.assertEqual(super_sum([1, 2, 3]), 6)
#all methods must start with test.
开发者ID:maureengithu,项目名称:bootcamp_7,代码行数:4,代码来源:test_super_sum.py
示例15: test_sum_of_items_in_one_list
def test_sum_of_items_in_one_list(self):
'''Test some of items in a single list'''
self.assertEqual(super_sum([1,3,4]),8)
开发者ID:Mugeri,项目名称:Bootcamp-7,代码行数:3,代码来源:test_super_sum.py
示例16: test_sum_of_integers
def test_sum_of_integers(self):
"""Test sum of integers"""
#super_sum(1,2,3) ===> 6
self.assertEqual(super_sum(1, 2, 3), 6)
开发者ID:JoyWangari,项目名称:bootcamp-7,代码行数:5,代码来源:test_super_sum.py
示例17: test_string_input
def test_string_input(self):
"""Test when string is passed into the function"""
#super_sum("string") ==> 0
self.assertEqual(super_sum("string", 1, 4), 0)
开发者ID:JoyWangari,项目名称:bootcamp-7,代码行数:5,代码来源:test_super_sum.py
示例18: test_empty_input
def test_empty_input(self):
'''Test empty input'''
self.assertEqual(super_sum(), 0)
开发者ID:Mugeri,项目名称:Bootcamp-7,代码行数:3,代码来源:test_super_sum.py
示例19: test_tuple_input_return_sum
def test_tuple_input_return_sum(self):
'''Test tuple input'''
self.assertEqual(super_sum([10],[20],[30]),60)
开发者ID:Mugeri,项目名称:Bootcamp-7,代码行数:3,代码来源:test_super_sum.py
示例20: test_string_input_returns
def test_string_input_returns(self):
'''Test when input is string'''
self.assertEqual(super_sum('hey how are you'),0)
开发者ID:Mugeri,项目名称:Bootcamp-7,代码行数:3,代码来源:test_super_sum.py
注:本文中的super_sum.super_sum函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论