本文整理汇总了Python中temp_conversion.fahr_to_kelvin函数的典型用法代码示例。如果您正苦于以下问题:Python fahr_to_kelvin函数的具体用法?Python fahr_to_kelvin怎么用?Python fahr_to_kelvin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fahr_to_kelvin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_random_value
def test_random_value():
fahr=randint(0,randint(0,100))
assert fahr_to_kelvin(fahr)==((fahr - 32) * (5/9))+273.15
#@raises(TypeError)
#def test_temp_string():
# assert fahr_to_kelvin("SomeTemperature")
#@raises(TypeError)
#def test_null_temp():
# assert fahr_to_kelvin()
示例2: test_run_1
def test_run_1():
assert fahr_to_kelvin (40) == 277.59444444444443
示例3: test_positive
def test_positive():
assert fahr_to_kelvin(50)>=273
示例4: test_random
def test_random():
assert fahr_to_kelvin(20.0)==266.4833333333333
示例5: test_basic_value
def test_basic_value():
assert fahr_to_kelvin(20)==266.4833333333333
示例6: test_negative_fahr
def test_negative_fahr():
assert round(fahr_to_kelvin(-100),2) == 199.82
示例7: test_null_input
def test_null_input():
fahr_to_kelvin()
示例8: kel_test_null
def kel_test_null():
fahr_to_kelvin(0)==(-32*(5/9))-273.15
示例9: test_fahr_greater
def test_fahr_greater():
assert fahr_to_kelvin(-10) > 0
示例10: test_kelvin2
def test_kelvin2():
assert round(fahr_to_kelvin(-200), 3) == 144.261
示例11: strin_test
def strin_test():
assert fahr_to_kelvin("some string")
示例12: test_kelvin1
def test_kelvin1():
assert round(fahr_to_kelvin(10), 3) == 260.928
示例13: test_run_3
def test_run_3():
assert round(fahr_to_kelvin(-459.67),2) == 0.00
示例14: test_run_2
def test_run_2():
assert fahr_to_kelvin('nn') == 0
示例15: test_temp_string
def test_temp_string():
"""check that a type error occurs"""
assert fahr_to_kelvin("SomeTemperature")